D
DaveM
Hi all
With a cell selected Sub Finddown will find the next same value down in the
column.
But if there is 4 entries of Smith, How could I stop at the 4th instead of
the code going to the top and finding the 1st Smith again
With Sub Findup How could I stop at the 1st instead of the code going to
the Bottom and finding the 4th Smith again
----------------------------------------------------------------------------
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
With a cell selected Sub Finddown will find the next same value down in the
column.
But if there is 4 entries of Smith, How could I stop at the 4th instead of
the code going to the top and finding the 1st Smith again
With Sub Findup How could I stop at the 1st instead of the code going to
the Bottom and finding the 4th Smith again
----------------------------------------------------------------------------
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