D
DaveM
Hi
I use these macros to highlight and find the next occurrence of a name in a
column.
Could anyone modify the code so when the code finds the last occurrence of a
name it does not start at the top of the column again.
and Sub findup not to go to the bottom of the column again.
example
Hightlight Cell
Sub Finddown()
Bill
Bill
Bill
Stop the macro
Stop the macro
Ben
Ben
Ben
Sub findup()
Sub Finddown()
Dim FoundCell As Range
Set FoundCell = ActiveCell.EntireColumn.Find(What:=ActiveCell.Value, _
After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing Then
FoundCell.Select
End If
End Sub
------------------------------------------
Sub findup()
On Error Resume Next
With ActiveCell
..EntireColumn.Find(What:=.Text, After:=.Cells(1, 1), LookAt:=xlWhole, _
LookIn:=xlValues, SearchDirection:=xlPrevious, MatchCase:=False).Select
End With
End Sub
Thanks in advance
Dave
I use these macros to highlight and find the next occurrence of a name in a
column.
Could anyone modify the code so when the code finds the last occurrence of a
name it does not start at the top of the column again.
and Sub findup not to go to the bottom of the column again.
example
Hightlight Cell
Sub Finddown()
Bill
Bill
Bill
Stop the macro
Stop the macro
Ben
Ben
Ben
Sub findup()
Sub Finddown()
Dim FoundCell As Range
Set FoundCell = ActiveCell.EntireColumn.Find(What:=ActiveCell.Value, _
After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)
If Not FoundCell Is Nothing Then
FoundCell.Select
End If
End Sub
------------------------------------------
Sub findup()
On Error Resume Next
With ActiveCell
..EntireColumn.Find(What:=.Text, After:=.Cells(1, 1), LookAt:=xlWhole, _
LookIn:=xlValues, SearchDirection:=xlPrevious, MatchCase:=False).Select
End With
End Sub
Thanks in advance
Dave