Excel to CSV

Swaroon

Active Member
Joined
Nov 18, 2005
Messages
288
Office Version
  1. 365
Hi,
I have an excel file and cells A1 to A3 look like

"data1" "data2" "data3" etc if cell is empty then it shows as ""

When I save the excel as a CSV file, and open in Notepad, I get

"""data1""","""data2""","""data3""", etc if cell is empty then it shows as """"""

But I want

"data1","data2","data3", etc if cell is empty then it shows as ""

The "" are added to the data in each cell in a range by means of a macro - can i remove the macro and use a file format to ge tthe required result ?
What am I doing wrong ?
thanks
Steve
 
Sorry, I don't understand. Your data should be contiguous starting in A1. The CurrentRegion property returns a range bounded by blank rows and columns. For this data it would be A1:D4:

A1</SPAN>
A2</SPAN>
B2</SPAN>
C2</SPAN>
D2</SPAN>
A3</SPAN>
B3</SPAN>
A4</SPAN>

<TBODY>
</TBODY>

It doesn't matter if some cells are blank provided that all cells in a column or row aren't blank. A csv created from that will have 4 rows and 4 columns.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,215,471
Messages
6,124,999
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top