R
Roy
Thanks in advance.
This is my code (courtesy Joe Fallon),but this just exports the data
and not the field names.What am I doing wrong?
Range("A20").Select
Set xlWorkSheet = xlWorkBook.Worksheets("GWM_WTD")
iRow = 20
For iCol = 0 To rs.Fields.COUNT - 1
xlWorkSheet.Cells(iRow, 32).Value = rs.Fields(iCol).Name
Next
xlWorkSheet.Range(xlWorkSheet.Cells(iRow, iCol), _
xlWorkSheet.Cells(iRow, rs.Fields.COUNT)).Font.Bold = True
'Do Until rs.EOF
xlWorkSheet.Cells(iRow, 32).CopyFromRecordset rs
The range is..the row starts at 20 and the column starts at 32.
Any help?
This is my code (courtesy Joe Fallon),but this just exports the data
and not the field names.What am I doing wrong?
Range("A20").Select
Set xlWorkSheet = xlWorkBook.Worksheets("GWM_WTD")
iRow = 20
For iCol = 0 To rs.Fields.COUNT - 1
xlWorkSheet.Cells(iRow, 32).Value = rs.Fields(iCol).Name
Next
xlWorkSheet.Range(xlWorkSheet.Cells(iRow, iCol), _
xlWorkSheet.Cells(iRow, rs.Fields.COUNT)).Font.Bold = True
'Do Until rs.EOF
xlWorkSheet.Cells(iRow, 32).CopyFromRecordset rs
The range is..the row starts at 20 and the column starts at 32.
Any help?