View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Help with Search Range in Function

Kirk,


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

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


--
Hope that helps.

Vergel Adriano


"kirkm" wrote:


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