Hi!
Office 2000 Access
I have a listbox on my form with 6 columns in it and some rows.
My purpose is to export data to Excel from that listbox and i can't get it done.
I have tried this:
But this code returns only 1 column, Header including.Code:Private Sub ReportToExcel_Click() 'EXPORT to EXCEL Dim xlApp As Excel.Application Dim xlSh As Excel.Worksheet Dim i As Long Set xlApp = New Excel.Application xlApp.Visible = True xlApp.Workbooks.Add Set xlSh = xlApp.Workbooks(1).Worksheets(1) For i = 1 To ReportRecordList.ListCount xlSh.Cells(i, 1).Value = ReportRecordList.ItemData(i - 1) Next Set xlSh = Nothing Set xlApp = Nothing End Sub
I can't understand what should i do with "i" to start pulling data from column 2 and so on...
Thanks in advance!
Ruslan.


Reply With Quote