Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Export CSV; first three rows contain record map

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



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
Export Single Record to Append to Access Table RMS Excel Discussion (Misc queries) 1 December 9th 08 07:08 PM
how to treat rows as one record John Harris Excel Discussion (Misc queries) 1 March 17th 06 01:01 AM
combining multiple rows into 1 record ccrydr Excel Worksheet Functions 3 February 14th 06 06:45 PM
combine 2 rows into 1 record GreenPower Excel Discussion (Misc queries) 1 December 30th 05 04:10 PM
Export Access Record to Specific Cells in Excel Elecdave Excel Discussion (Misc queries) 0 December 29th 04 04:49 PM


All times are GMT +1. The time now is 08:13 PM.

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"