Scope and Global Range error
Posted by Melanie Swarner on November 08, 2001 6:27 AM
I have recorded the following macro.
Public Sub ApplyAdvancedFilter()
Range("Database").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range _
("Criteria"), CopyToRange:=Range("Extract"), Unique:=True
I had it in my "personal.xls" and attached it to a button on my toolbar. It worked fine in any worksheet with named ranges Database, Criteria and Extract.
Now, I have another subprocedure that calls it. It didn't want to work in personal. It said it was not defined so I tried moving it into a module in my application. Then it said global object range not defined.
Any ideas? Is there some way to make a subprocedure global or am I just missing something?