export column headers to a CSV file
I am using this code:
Write #1, List1.ListItems(i).Text, List1.ListItems(i).ListSubItems(1).Text, _
List1.ListItems(i).ListSubItems(2).Text, List1.ListItems(i).ListSubItems(3).Text, _
List1.ListItems(i).ListSubItems(4).Text, List1.ListItems(i).ListSubItems(5).Text
It works, but there could be more than the 4 rows. Is there a way of exporting this according to the number of columns (each has to be seperated by a comma and has to be one command)?
Write x, y, z, ...
I can get the column headers into a temp var, but it copies all headers into a single cell (spreadsheet)
For i = 1 To List1.ColumnHeaders.Count
tmpHeaders = tmpHeaders & "," & List1.ColumnHeaders(i).Text
Next i
thanks