MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Export to a csv file

Posted by Anita on September 18, 2000 5:20 AM


I don't know if this is possible but I have a file which I want to save in a csv format but I don't want blank lines saved.

I'm running a macro to do this, so is there any option in code?

Any help would be greatly appreciated.


Posted by DoughBoy on September 19, 0100 12:53 AM

this sub is from one of Celia's answers

Sub HideBlankRows()
Dim rng As Range, cell As Range
Set rng = Application.Intersect(ActiveSheet.UsedRange, Range("A:A"))
For Each cell In rng
If Application.CountA(cell.EntireRow) = 0 Then cell.EntireRow.Delete
End Sub

run it before you save

Posted by Anita on September 20, 0100 9:05 AM

Thanks for this!