Find a value if there continue

T

Tempy

Could somebody please help me out of my frustrated state !!
I have an input box that gives me myValue, i then want to look for that
value in a range on another sheet and if found carry on with the code,
if not error msg.


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
R

Ron de Bruin

Try this

Sub test()
Dim FindString As String
FindString = InputBox("Enter a Search value")
If Application.WorksheetFunction.CountIf(Sheets("Sheet2") _
.Range("A1:A100"), FindString) > 0 Then
MsgBox "your code"
Else
MsgBox "findstring is not in the range"
End If
End Sub
 

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


Top