Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy and paste in excel

Status
Not open for further replies.

GHOST24

Programmer
Jul 7, 2005
22
GB
I am trying to get the data from a sql table in to an Excel template using the copyfromrecordset method.
The data goes into the Excel sheet but I want to display it vertically not horizontally, a friend has helped me so far but I can not make it work the data goes into the first range but does not copy.



osheet.range("S14").copyfromrecordset(rs) 'this is the one i need to get vertical
osheet.cells("S14").CurrentRegion.Copy()
'osheet.Range("C3").PasteSpecial(Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True)
osheet.Range("C3").PasteSpecial(Paste:=oexcel.PasteAll, Operation:=oexcel.None, SkipBlanks:=False, Transpose:=True)
 
Rather than using Copy/Paste, wouldn't you be better off setting the individual cell text if you need to show the data in an unusual format (i.e. vertically)?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top