May have over thought these but
Dim Rng As Range, FndLast As Range
Dim FndWrd As String
Dim i As Long, LastRow As Long, WrdCnt As Long
FndWrd = "Ford"
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Range("A1:A" & LastRow)
WrdCnt = WorksheetFunction.CountIf(Rng, FndWrd)
MsgBox WrdCnt
For i = 1 To LastRow
If Cells(i, "A").Value = FndWrd Then
MsgBox Cells(i, "A").Address(0, 0)
Exit For
End If
Next i
Set FndLast = Rng.Find(FndWrd, After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
If Not FndLast Is Nothing Then
MsgBox FndLast.Address(0, 0)
End If
or
Dim Rng As Range, FndFirst As Range, FndLast As Range
Dim FndWrd As String
FndWrd = "Ford"
Set Rng = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
MsgBox WorksheetFunction.CountIf(Rng, FndWrd)
If Range("A1").Value = FndWrd Then
MsgBox Range("A1").Address(0, 0)
Else
Set FndFirst = Rng.Find(What:=FndWrd)
If Not FndFirst Is Nothing Then
MsgBox FndFirst.Address(0, 0)
End If
End If
Set FndLast = Rng.Find(FndWrd, After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
If Not FndLast Is Nothing Then
MsgBox FndLast.Address(0, 0)
End If
VBA Noob
Bookmarks