Global definitions

rjplante

Well-known Member
Joined
Oct 31, 2008
Messages
574
Office Version
  1. 365
Platform
  1. Windows
I have several macros (8 of them) that are linked. At the end of macro 1 I call macro 2. At the end of macro 2, I call macro 3 and so on. The macros apply a series of filters to a worksheet. One of the filters has a lot of names in them. Is it possible to define a global definition of the filter names so that if I need to add an additional name, it is only in one area. Then when I apply the filter in each macro, I can just use the defined name from my global definitions list. I have some sample code of what it would look like below.

Code:
GlobalDim MAPC As Long

MAPC = "2500", "2501", "2502", "2502A", "2503", "2504", "2505", _        "ABC001", "ABC002", "TEST-TOOL", "LLL-MORE"

    ActiveSheet.Range("$A$5:$O" & lastrow).AutoFilter Field:=13, Criteria1:=Array( MAPC), Operator:=xlFilterValues

Let me know if this is possible.

option 2

Is it possible to set up an array filter where I can use an asterisk with the list to catch everything in the filter. For example "2500", "2501", "2502", "2502A", "2503", "2504", "2505" = "250**".

Thanks for the help.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,956
Messages
6,175,609
Members
452,660
Latest member
Zatman

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