View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steved Steved is offline
external usenet poster
 
Posts: 519
Default find the last Fred and goto cell

Thankyou.

"Dave Peterson" wrote:

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

Steved wrote:

Hello from Steved

How do I ask the below to find the Last "Fred" please

Sub Find()
Cells.Find(What:="Fred", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

End Sub

Thankyou.

"Don Guillett" wrote:

Look in the vba help index for FIND and then xlprevious from the bottom up

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Steved" wrote in message
...
Hello from Steved

Using the below I want to have a macro that will find the last Fred which
in
this case is in Cell A4 and put the cursor there please.

A1...Fred
A2...Biff
A3...Fred
A4...Fred
A5...Lisa

Thankyou




--

Dave Peterson