Hi
Sub MyMacro()
SearchValue
Do
searchvalue = inputbox("What number do you want to search for? Enter Stop to quit")
set c = .find(What:=searchvalue,lookat:=xlwhole,lookin:=xlvalues)
if c is nothing then
else
c.address.offset(0,5).formulaR1C1=date
end if
Loop while searchvalue<>"Stop"
End Sub
HTH
Jacob
when I try to run it I get a compile error, invalid or unqualified reference for ".find" after set c, I am using Excel '97 if that helps
Hi
I forgot the With statement. Duh.
This one works I just tried it.
Sub MyMacro()
Do
searchvalue = InputBox("What number do you want to search for? Enter Stop to quit")
With Range("A1:A65536")
Set c = .Find(What:=searchvalue, lookat:=xlWhole, LookIn:=xlValues)
If c Is Nothing Then
Else
Range(c.Address).Offset(0, 5).FormulaR1C1 = Date
End If
End With
Loop While searchvalue <> "Stop"
End Sub
Jacob
maybe I am doing something wrong, I put the code in a module but now when it runs I get compile error variable not defined and "SearchValue" is highlighted Hi I forgot the With statement. Duh.
You need to dim searchvalue eg
Dim searchvalue
Note: the code will stop @ the 1st occurance
of the searchvalue and will search no more.
If this is what you want the OK....otherwise
I'm sure Jacob will amend....if not repost
Ivan
Thanks ,I also had to dim "c", whatever dim is
Dim searchvalue Note: the code will stop @ the 1st occurance