View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Pete McCOsh Pete McCOsh is offline
external usenet poster
 
Posts: 64
Default Cells.find restricted to a single range??

Steff,
replace "Cells.Find" with the following, if "rngtest" is a
variable in your code:

rngtest.find

If "rngtest" is a named range in the workbook:

Range("rngtest").find

Cheers, Pete.

-----Original Message-----
I have the below code to search for a number in my sheet.

However, I only want to search the range "rngtest", and

if the number
does not exist in that range, it should return only a

msgbox saying no
such entry.

What should be changed???


Dim iSpecific As integer
Cells.Find(What:=iSpecific, After:=Range("A1"),

LookIn:=xlFormulas,
LookAt _
:=xlWhole, SearchOrder:=xlByColumns,

SearchDirection:=xlNext,
MatchCase _
:=False, SearchFormat:=False).Activate

Cheers

Steff