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)
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)