-1

Suppose I have Workbook(Report.xlsx) and in that workbook I have different worksheet. In every sheet I have a column name B_Code. Using filter in B_Code I want a separate workbook with every sheet in it.

Just like in Picture 1 you can see Sheet 1 has B_Code. Just like in Picture 1 you can see Sheet 1 has B_Code.

Similarly in Sheet 2 also I have B_Code in it. Similarly in Sheet 2 also I have B_Code in it.

Now I want the data of 001 i.e. Ram in Sheet 1 as well as in Sheet 2 in same workbook as file name 001 and 002 i.e. Hari in Sheet 1 as well as in Sheet 2 in another workbook as file name 002 and so on.

Can anyone help me out to solve this problem using VBA.

  • Copy unique B_Code values to an array or to a collection. Then iterate for each value performing: 1) Make a copy of the original workbook (with the name built using current value); 2) Open this copy; 3) Delete all rows with B_Code NOT EQUAL to current value; 4) Close copy. – Akina Nov 12 '18 at 6:50
  • Look at superuser.com/questions/1374686/… for some of the code you will need to follow the steps that @Akina described. (This question is a duplicate of that question.) – scenography Nov 15 '18 at 20:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.