Copy data into new workbook with constraints

Closed
antelope - Feb 28, 2011 at 10:57 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 28, 2011 at 03:41 PM
Hi,

I'm looking to use VBA to copy data into a new Excel workbook using certain constraints.

I have data on a worksheet called "Data" with multiple rows and columns:

Col A Col B
A 1
A 2
B 1
B 2
B 3
C 3
C 4
D 2
D 4
D 5

I want to do the following:
1) create a new workbook named after the letter in Col A (A, B, C, etc) if the letter appears on a separate worksheet (e.g. within a range of cells named "Areas" on worksheet "Summary")
2) copy all rows (from Col A to Col T only) into the corresponding new workbooks only if Col B contains a value that appears on a separate worksheet (e.g. within a range of cells named "Class" on worksheet "Summary")

So e.g. if "Areas" contains A, C and D, and "Class" contains 1, 4 and 5, then I want to create 3 new workbooks only and each should contain the following lines:
Workbook A - row 1
Workbook C - row 7
Workbook D - rows 9 and 10

Thanks very much in advance for your help!

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 28, 2011 at 03:41 PM
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note:
your data need not be to be real data but a good representative of how data looks like
0