Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Help with Search Range in Function


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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to keep a set range in a Search function Connie Excel Worksheet Functions 1 August 6th 08 08:24 PM
Search range for text not in another range simon howard Excel Discussion (Misc queries) 3 March 28th 07 08:44 PM
Search Range for item in seperate range [email protected][_2_] Excel Programming 6 January 9th 06 03:53 PM
How do I create a function to search a range for a number and... NECCExcel Excel Worksheet Functions 2 November 18th 05 09:14 PM
How to search a range for a suburb in a large range Bogan.. Excel Programming 2 June 22nd 05 01:20 PM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"