Hi:
I am using the code below on a sheet in order to do a search. What can I add to it so that the code ONLY seraches in columns A C and D. I do not want to search any other columns.
Here is the code:
Code:
Private Sub CommandButton1_Click()
'Search
Dim Found As Range, tempcell As Range, Response As Integer, X
X = InputBox("Please enter the Text or Numbers you want to find", vbOKCancel)
Set Found = Cells.Find(what:=X)
If X = "" Then Exit Sub
If Found Is Nothing Then
MsgBox X & " Not Found"
Exit Sub
Else
Application.Goto reference:=Found, Scroll:=True
End If
Response = MsgBox("Find Next Record", vbYesNo)
If Response = vbYes Then
Do
Set tempcell = Cells.FindNext(After:=Found)
If Found.Row >= tempcell.Row And Found.Column >= tempcell.Column Then
MsgBox "You are at the last record."
Exit Do
End If
Set Found = tempcell
Application.Goto reference:=Found, Scroll:=True
Response = MsgBox("Find Next Record", vbYesNo)
If Response = vbNo Then Exit Do
Loop
End If
End Sub
THANKS to anyone that can assist.
Take Care,
Mark