ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find a value if there continue (https://www.excelbanter.com/excel-programming/298859-find-value-if-there-continue.html)

Tempy

Find a value if there continue
 
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!

Ron de Bruin

Find a value if there continue
 
Try this

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


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Tempy" wrote in message ...
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!




Tempy

Find a value if there continue
 
One day i'll also be big !!

Thanks Ron, saved my life again.

Les Stout

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


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com