Hi Gord
I have adjusted the code to match my need, I was obviously being to generic
Sub TestFindManufacturer()
whatname = InputBox("Insert Name Here")
Sheets("Network").Select
With ActiveSheet.Range("A:F")
Set k = .Find(whatname, LookIn:=xlValues, lookat:=xlPart)
If Not k Is Nothing Then
firstAddress = k.Address
Do
MsgBox k.Offset(0, -2).Address
Set k = .FindNext(k)
Loop While Not k Is Nothing And k.Address <> firstAddress
End If
End With
If k Is Nothing Then
MsgBox ("name not found")
End If
End Sub
I know in K there is definitely 'Citroen' however the response given is name not found?
Have I adjusted the code to the extent it will not work?
The code I am currently using is below
Sub FindManufacturer()
Dim SearchFor As Variant
Dim rCell As Excel.Range
Dim firstAddress As String
Dim strMessage As String
SearchFor = Range("J14")
With Worksheets(2).Cells
Set rCell = .Find(SearchFor, LookIn:=xlValues)
If Not rCell Is Nothing Then
firstAddress = rCell.Address
strMessage = rCell.Address(external:=True)
Do
Set rCell = .FindNext(rCell)
If rCell Is Nothing Or rCell.Address = firstAddress Then Exit Do
strMessage = strMessage & vbCr & rCell.Address(external:=True)
Loop
End If
End With
MsgBox strMessage
End Sub
But this will only tell me the cell location and not the Name of the repairer (COLOUMN A) or repairers that has the matching manufacturer found in coloumn K