count 1st cell and last cell that contain specific word
Select column A and run:
Sub find_um()
firstt = False
v = "grp"
For Each r In Selection
If v = r.Value Then
If firstt Then
lastone = r.Address
Else
lastone = r.Address
firstone = r.Address
firstt = True
End If
End If
Next
MsgBox (firstone & Chr(10) & lastone)
End Sub
--
Gary''s Student - gsnu2007d
"crapit" wrote:
From a column e.g "A"
How to determine the 1st cell and the last cell that contain a specific
word?
A B C
1
2 grp
3 grp
4
5 grp
6
7 hex
8 hex
9 hex
10 grp
11 grp
|