Thread
:
Help with Instr function
View Single Post
#
6
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Help with Instr function
Read ALL of what Dave said
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"JMay" wrote in message
...
Sorry but even after changing
If Temp 0 Then to
If T 0 Then
I still get same result,,
grrrrrrrr
"JMay" wrote:
In cell A1 I have: The Sky is blue
In the input box I enter blue
After running the below (99 times) i get - Didn't Find it! - 99 times
!!!
Why?
Sub Foo()
Dim T As Integer
Dim Z As String
Z = InputBox("Enter key word") 'enter blue
T = InStr(1, Z, ActiveSheet.Range("A1"), vbTextCompare)
If Temp 0 Then
MsgBox "Found it!"
Else
MsgBox "Didn't Find it!"
End If
End Sub
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett