Export CSV; first three rows contain record map
You can try adding code like this.
for each rw in Range(1:3).rows
for each cell in rw.cells
if cell.Value = "+" then
Range(cell.offset(0,1),cells(cell.row,256)).ClearC ontents
exit for
end if
Next
Next
' no export the CSV
--
Regards,
Tom Ogilvy
"DW" wrote in message
om...
Hello All
I have a situation where I have a worksheet with rows of data to
export to a CSV file using VBA. Simple enough. Now for the kicker.
The first three rows are record maps ending with a "+" and I need to
parse them to Row1 = 10 records, Row2 = 5 records and Row3 = 10
records while the data in the remaining rows will contain 50 records.
i.e. csv output now:
Name,Date,,,,,,,,,+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,
GL,,,,,+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,
Location,State,,,,,,,,,+,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
desired csv output:
Name,Date,,,,,,,,,+
GL,,,,,+
Location,State,,,,,,,,,+
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
data,data,data,data,data,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,
I am trying to avoid manual edit of csv file after export; dealing
with a repetitive process with multiple files.
Any suggestions?
Thanks in advance
DW
|