Extra rows in csv file

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

When I save a worksheet as a .csv file via macro
(using "ActiveWorkbook.SaveAs FileNameString,
FileFormat:= xlCSV, CreateBackup:=False"), Excel seems to
add a large number of empty rows (all commas, no data) at
the bottom of the rows with data.

Any way to tell it how many rows to save, without the
rows of nulls?

Thanks in advance

kevin
 
do edit =>goto => Special => Last Cell

do you end up well past your data. If so, you need to delete entire rows
below your last filled cell

set rng = cells(rows.count,1).End(xlup)
rows(rng.row+1 & ":65536").Delete
ActiveSheet.UsedRange
' now save the file

This assumes these rows are actually empty.
 
Back
Top