Help with Search Range in Function

K

kirkm

I'm sending an argument into a function -

Function Find_Them(Find_Item As Variant, Search_Range As Range,
Optional LookIn As Variant, Optional LookAt As Variant, Optional
MatchCase As Boolean) As Range



The problem is 'Search_Range As Range'.

If I call the function from code behind sheet, all Search_Range
needs is e.g.

? search_range.address
$J$2:$J$8964

and it works.

But if I call the function from a module, it fails because I cannot
figure out how to tell the function what Sheet to use.

Can I include within the Search_Range argument the name of the Sheet?

Thanks - Kirk
 
G

Guest

Kirk,


Worksheets("Sheet1").Range("A1:A100")

would mean A1:A100 range in the sheet named as "Sheet1".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top