I have a search macro that works quite well. (search code was found on this site, i do not take credit for writing this, i did modify it slightly) But i wanted to modify it so it only searches in column A (which contains text/numbers.. p90834.pdf) and if found....... it gets highlighted......which works. But in column B ..... next to the cell I would like it to write .... Yes. The reason for this is because column B is the result column..... was it found? Here is the code.....
thanks in advance
golf401
Code:
Sub Test()
Dim What As String
Dim Found As Range
Dim firstAddress As String
Dim Response
What = InputBox("Search for :")
If What = "" Then Exit Sub
Set Found = Cells.Find(What)
If Not Found Is Nothing Then
firstAddress = Found.Address
Do
Found.Activate
Response = MsgBox("Highlight?", vbYesNo + vbQuestion)
If Response = vbNo Then Exit Sub
If Response = vbYes Then
ActiveCell.Interior.Color = vbYellow
End If
Set Found = Cells.FindNext(After:=ActiveCell)
If Found.Address = firstAddress Then Exit Do
Loop
End If
MsgBox "Search Ended!"
End Sub
Private Sub CommandButton1_Click()
Call Test
End Sub
golf401