export to Excel

bbulla

I'd rather be golfing
Local time
Today, 04:30
Joined
Feb 11, 2005
Messages
101
Hi,

I'm exporting data from a query to an existing excel spreadsheet. Currently the spreadsheet has 200 rows of data. From the code below, you can see that I am only adding to column A, and adjusting the row height/column width each time, so that the data will fit into the cell properly.

Do Until numRec = 0
xl.Range("A" & numRow & "").RowHeight = 55
xl.Range("A" & numRow & "").ColumnWidth = 23
xl.Range("A" & numRow & "").Value = rsExcel![DC_NAME]
numRow = numRow + 1
numRec = numRec - 1
rsExcel.MoveNext
Loop

After row 200 (where the spreadsheet currently has no data), the row height is not getting adjusted. Can anyone explain why?? Is there a better way to do this??

Also, for the new data I am adding, is there a way to format each cell so that it has a thin border on all 4 sides?

Thanks,

Brian
 

Users who are viewing this thread

Back
Top Bottom