Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Extra rows in csv file

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Extra rows in csv file

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.

--
Regards,
Tom Ogilvy



"Kevin" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are the extra columns and rows? frankoamerican Excel Discussion (Misc queries) 6 January 15th 09 10:07 PM
get rid of extra rows kendallzemp New Users to Excel 2 September 14th 07 05:55 AM
Why the extra rows?? Robert Brown Excel Discussion (Misc queries) 3 July 28th 06 03:13 PM
extra rows and columns Wooster New Users to Excel 3 December 4th 05 12:45 AM
how do I get rid of extra rows sarahtar Excel Discussion (Misc queries) 1 November 13th 05 03:30 AM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"