Hello There,
Thank you for taking the time to look into my post and helping me out.
I have a workbook with 3 worksheets as below:
1. "Customer Header" --> Columns Customer ID, Customer Name & Amount
(This contains unique row for each Customer ID and their details)
2. "Customer Lines" --> Columns Customer ID, Customer Name, Line Number & Line Amount
(For each of the Customer Header -- Customer ID it can have multiple rows)
3. "Summary" --> Columns Customer ID, Date Created, CSV File Header, CSV File Lines & Number of Rows in each file
(This worksheet reflects the summary fof the operation)
I am looking for VBA module code to perform the following:
1. Split Data: Loop through each row in worksheet "Customer Header"
-Create a worksheet with worksheet name = Customer ID value suffixed with text "_Header"
-In worksheet "Customer Lines", find it's related Customer ID rows and copy these rows.
-Create a worksheet with worksheet name = Customer ID value suffixed with text "_Lines" and paste these copied rows here.
2. CSV File: Loop through each newly created worksheets (i.e. "......_Header" & "....._Lines").
-Create a csv file with the same name as worksheet name.
-In a new row, reflect the following in the worksheet "Summary", for each Customer ID:
-CSV File names
-Customer ID
-Number of rows in the worksheets "..._Header" & "...._Lines"
-and reflect these in the worksheet "Summary"
-Delete the respective worksheet (i.e. "......_Header" & "....._Lines"), for which the csv file was created
3. Clear worksheets "Customer Header" & "Customer Lines"
I wonder if it is possible to create csv files after filtering the rows in the worksheet "Customer Lines" (i.e. without copy & paste in new worksheet and then create csv).
I have attached a sample workbook for your reference.
Look forward to hearing from you.
Thank you & regards,
Don
Thank you for taking the time to look into my post and helping me out.
I have a workbook with 3 worksheets as below:
1. "Customer Header" --> Columns Customer ID, Customer Name & Amount
(This contains unique row for each Customer ID and their details)
2. "Customer Lines" --> Columns Customer ID, Customer Name, Line Number & Line Amount
(For each of the Customer Header -- Customer ID it can have multiple rows)
3. "Summary" --> Columns Customer ID, Date Created, CSV File Header, CSV File Lines & Number of Rows in each file
(This worksheet reflects the summary fof the operation)
I am looking for VBA module code to perform the following:
1. Split Data: Loop through each row in worksheet "Customer Header"
-Create a worksheet with worksheet name = Customer ID value suffixed with text "_Header"
-In worksheet "Customer Lines", find it's related Customer ID rows and copy these rows.
-Create a worksheet with worksheet name = Customer ID value suffixed with text "_Lines" and paste these copied rows here.
2. CSV File: Loop through each newly created worksheets (i.e. "......_Header" & "....._Lines").
-Create a csv file with the same name as worksheet name.
-In a new row, reflect the following in the worksheet "Summary", for each Customer ID:
-CSV File names
-Customer ID
-Number of rows in the worksheets "..._Header" & "...._Lines"
-and reflect these in the worksheet "Summary"
-Delete the respective worksheet (i.e. "......_Header" & "....._Lines"), for which the csv file was created
3. Clear worksheets "Customer Header" & "Customer Lines"
I wonder if it is possible to create csv files after filtering the rows in the worksheet "Customer Lines" (i.e. without copy & paste in new worksheet and then create csv).
I have attached a sample workbook for your reference.
Look forward to hearing from you.
Thank you & regards,
Don