VBA to copy using range as criteria

xceptional88

New Member
Joined
Dec 10, 2017
Messages
6
Hi folks

I am not very advance user and can write basic codes but I have spent quite a while on this and could not make it work so asking for your help.

I have one workbook with multiple sheets as below

Sheet1 (Actual Input data for over 400,000 lines)

Region Location Accounts Amounts Date Starting-Balance Ending-Balance Comments
Ontario 00001 123456 100 2018/06/13 40 75 issued
Ontario 00004 123456 250 2018/06/13 50 95 blank
Quebec 00005 123456 60 2018/06/13 90 100 to be investigated
Quebec 00009 456789 50 2018/06/12 12 44
BC 00007 456789 10 2018/06/12 23 32

Sheet2 (Variants)
Number Name Region Location Accounts
1 RB Team Ontario 123456
1 RB Team 456789
2 HM Team 00009 123456
2 HM team 00001 456789
2 HM Team 00004




Sheet3 (Tab Names)
RB Team
HM team

My objective:
I have large file (sheet1) from where I want to apply multiple filters (each of the variant on Variants tab) and export them to another workbook using tab names of the worksheets as in Tab Names sheet.

What I am doing:
On 'Variants' tab I am filtering by number for one variant, select the fields and applying filter on sheet1 (actual data) and then export it to new tab. Do this for all variant numbers. However I am unable to make it work and have tried several things.

Issues:
-Not able to apply multiple filters even using advance filters (I am probably using it wrong)
-Some variants have Region some have location so selecting one will mean other is blank and I do not want to filter for blanks for that criteria

If you would approach it differently I am open to that as well.

Thankyou for your help guys. I know this is going to be complex :)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top