Exporting to csv

June 9, 2011 at 06:06:04
Specs: Windows XP

I'm trying to export a worksheet to csv. However, when I export to csv. empty cells are being seperated by commas. I believe that this is being caused by various formulas with " " in them.

Is there anyway that I can solve this issue? the csv file is to be imported into another application, therefore empty files need to be empty.

Any help will be greatly be apprecaited.



See More: Exporting to csv

Report •

June 9, 2011 at 12:11:13
caused by various formulas with " " in them.

Change " " to ""



Report •

June 17, 2011 at 06:40:23
Hi Mike,

many thanks for your reply.

I have tried to remove all the " " to "". Unfortunately it does not seem to work.

In the first row of my WS I have data in col A-D in the row 2 I have data from A-M. When I save as csv, the csv file will show 9 extra commas in the first row. I need to import the file into another system therefore I need to remove the commas.

I do not want to have to enter word pad and manually delete these commas. I have been reading up on this and from what i undersand there is some VB code that can be used to stop this.

I have a VERY simple macro to save as csv.

Sub createCustomerfile()

Sheet3.SaveAs Filename:="H:\" & Worksheets("Customer Account").Range("B1") & ".csv", _

End Sub

Is there anything I can add to this code that will get rid of the extra commas?

Any tips will be greatly appreciated.


Report •

June 17, 2011 at 16:01:49
I understand your problem, but have no solution.

Unfortunately there is no standards for CSV files.

You will have to post process the file in some manner to eliminate the unwanted commas.

There may be a VBA solution, but my coding skill are nill.

Perhaps someone else can offer something.

You might also ask in the Programming Forum, and see if there is a Batch solution if you get no response on a VBA solution.



Report •

Related Solutions

Ask Question