joe.muckle
Board Regular
- Joined
- Oct 19, 2010
- Messages
- 132
Hi Guru's
I have just come accros a macro which allows me to search and then find next (... I know Ctrl + F !!!!!!).
The code is below:
Does any one know how to change this so that I am only looking in Columns B and C ??
Im guessing it is within this part but I cannot work out the format.
Thanks in advance.
I have just come accros a macro which allows me to search and then find next (... I know Ctrl + F !!!!!!).
The code is below:
Code:
Sub nthmatch()
lookfor = InputBox("What is the Item number? Use * if end of number is unknown.", "Search")
If lookfor = "" Then
End
End If
Flag1:
If Not Cells.Find(What:=lookfor, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False) Is Nothing Then
Cells.Find(What:=lookfor, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
If MsgBox("Is this the correct Item?", vbYesNoCancel) <> vbYes Then
GoTo Flag1
End If
Else
MsgBox ("The Item is not in the list")
End If
End Sub
Does any one know how to change this so that I am only looking in Columns B and C ??
Im guessing it is within this part but I cannot work out the format.
Code:
If Not Cells.Find(What:=lookfor, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False) Is Nothing Then
Thanks in advance.