S
Steved
Hello from Steved
Using the Below to find the last name Fred in Col A I would like please to
have the cursor in Cell A2 then Highlite the Cells to the last Name Fred then
once found Highlite 7 colums to the right, so for example the last Fred may
be found in Cell A 47, so in this intance the highlighted cells would be A2:
G47 Thankyou.
Option Explicit
Sub myFind()
Dim FoundCell As Range
With ActiveSheet
With .Range("a:a")
Set FoundCell = .Cells.Find(what:="Fred", _
after:=.Cells(1), _
LookIn:=xlValues, _
lookat:=xlWhole, _
SearchOrder:=xlByRows, _
searchdirection:=xlPrevious, _
MatchCase:=False)
End With
End With
If FoundCell Is Nothing Then
MsgBox "Fred wasn't found!"
Else
Application.Goto FoundCell, scroll:=True
End If
End Sub
Using the Below to find the last name Fred in Col A I would like please to
have the cursor in Cell A2 then Highlite the Cells to the last Name Fred then
once found Highlite 7 colums to the right, so for example the last Fred may
be found in Cell A 47, so in this intance the highlighted cells would be A2:
G47 Thankyou.
Option Explicit
Sub myFind()
Dim FoundCell As Range
With ActiveSheet
With .Range("a:a")
Set FoundCell = .Cells.Find(what:="Fred", _
after:=.Cells(1), _
LookIn:=xlValues, _
lookat:=xlWhole, _
SearchOrder:=xlByRows, _
searchdirection:=xlPrevious, _
MatchCase:=False)
End With
End With
If FoundCell Is Nothing Then
MsgBox "Fred wasn't found!"
Else
Application.Goto FoundCell, scroll:=True
End If
End Sub