Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default using range name in Find

Hi All,

I have a range named OMSZ, and I'd like to use this name in Find, but this
line gives an error:
MyVar = ThisWorkbook.Names("OMSZ").Find("StringToSearchFor ", [A1], , ,
xlByRows, xlNext).Row
What is the correct syntax?
The named range is OK, because e.g.
MyRange = ThisWorkbook.Names("OMSZ").RefersTo
gives back the correct range.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default using range name in Find

..Find is a method of a Range object. Try either Range("OMSZ").Find or
Range(MyRange).Find.
Mike F
"Stefi" wrote in message
...
Hi All,

I have a range named OMSZ, and I'd like to use this name in Find, but this
line gives an error:
MyVar = ThisWorkbook.Names("OMSZ").Find("StringToSearchFor ", [A1], , ,
xlByRows, xlNext).Row
What is the correct syntax?
The named range is OK, because e.g.
MyRange = ThisWorkbook.Names("OMSZ").RefersTo
gives back the correct range.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default using range name in Find

Thanks Mike,
having made some experiments I found this form working:
MyVar = ThisWorkbook.Names("OMSZ").RefersToRange.Find("Str ingToSearchFor",
[A1], , , xlByRows, xlNext).Row

Is there a simpler one?

Regards,
Stefi

€žMike Fogleman€ ezt Ã*rta:

..Find is a method of a Range object. Try either Range("OMSZ").Find or
Range(MyRange).Find.
Mike F
"Stefi" wrote in message
...
Hi All,

I have a range named OMSZ, and I'd like to use this name in Find, but this
line gives an error:
MyVar = ThisWorkbook.Names("OMSZ").Find("StringToSearchFor ", [A1], , ,
xlByRows, xlNext).Row
What is the correct syntax?
The named range is OK, because e.g.
MyRange = ThisWorkbook.Names("OMSZ").RefersTo
gives back the correct range.




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
Find Last cell in Range when range is date format default105 Excel Discussion (Misc queries) 5 July 7th 09 03:11 PM
Find the MAX number in range, then find... pgarcia Excel Discussion (Misc queries) 4 September 19th 08 06:58 PM
Find a range of values in a range of cells Jack Taylor Excel Worksheet Functions 20 November 25th 06 01:26 PM
Find dates in a range; then sum values in that range by a criteria Anders Excel Discussion (Misc queries) 4 October 21st 05 03:41 PM
Find first cell in range and expand range -VBA Caméléon Excel Programming 3 December 4th 04 02:01 AM


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

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

About Us

"It's about Microsoft Excel"