determine if value exists

G

Guest

hi,

I am trying write code to determine if a specific value, lets say "DOODLE"
exists within a specified range in an excel sheet. The range specified could
be J12:J88 for example.

Thanks in advance,
geebee
 
D

Die_Another_Day

With Code or a function?
code:
Dim SearchCell As Range
Set SearchCell = Range("J12:J88").Find(What:="DOODLE",LookAt:=xlWhole)
If SearchCell Is Nothing Then
MsgBox "DOODLE Does Not Exist in Range J12:J88"
End If

Function:
If(Iserror(Match("DOODLE",J12:J88,0)),"Not There","Found At: J" &
(Row() - 1 + Match("DOODLE",J12:J88,0))

HTH

Charles Chickering
 
B

Bob Phillips

If Not IsError(Application.Match("DOODLE",Range("J12:J88"),0)) Then
'value found
Else
'value is not found
End If

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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

Similar Threads

determine dropdown value 1
Value from one sheet paste under same value on other sheet. 7
Determine if Sub Exists 4
Which day 5
cell value 2
increase range programmatically 1
paste into new sheets 4
format 5

Top