I have the following code to find whatever is entered into the input box - move 11 columns right and enter "Y" in this cell;
Dim strFindText As String
strFindText = InputBox("type a number"
If strFindText <> "" Then Range("p1".Value = strFindText
With Sheets("sheet1".Range("d:d"
Set c = .find(strFindText, LookIn:=xlValues)
c.Offset(0, 11).Select
ActiveCell.FormulaR1C1 = "Y"
msg = "Another Number?"
ans = MsgBox(msg, vbYesNo)
Do Until ans = vbNo
strFindText = InputBox("type a number"
Set c = .find(strFindText, LookIn:=xlValues)
c.Offset(0, 11).Select
ActiveCell.FormulaR1C1 = "Y"
msg = "Another Number?"
ans = MsgBox(msg, vbYesNo)
Loop
End With
When cancel is pressed on the input box, a "Y" is put in cell o5 (only and always o5)...I thought the second line of code would stop it but it hasn't....I must need to add something else - but I'm only a newbie to vba and am not sure what?
Thanks in advance for your help
Dim strFindText As String
strFindText = InputBox("type a number"
If strFindText <> "" Then Range("p1".Value = strFindText
With Sheets("sheet1".Range("d:d"
Set c = .find(strFindText, LookIn:=xlValues)
c.Offset(0, 11).Select
ActiveCell.FormulaR1C1 = "Y"
msg = "Another Number?"
ans = MsgBox(msg, vbYesNo)
Do Until ans = vbNo
strFindText = InputBox("type a number"
Set c = .find(strFindText, LookIn:=xlValues)
c.Offset(0, 11).Select
ActiveCell.FormulaR1C1 = "Y"
msg = "Another Number?"
ans = MsgBox(msg, vbYesNo)
Loop
End With
When cancel is pressed on the input box, a "Y" is put in cell o5 (only and always o5)...I thought the second line of code would stop it but it hasn't....I must need to add something else - but I'm only a newbie to vba and am not sure what?
Thanks in advance for your help