LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 519
Default Highlite from A2 to Last Fred then to Column G

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find the last Fred and goto cell Steved Excel Worksheet Functions 6 October 11th 07 06:53 PM
How do you count number of times Fred Smith appears in a list Geoff Excel Discussion (Misc queries) 1 October 5th 07 04:58 PM
Are Fred Pryor Seminars good? [email protected] Excel Discussion (Misc queries) 10 November 15th 06 05:51 AM
I need help fred smith scats Excel Worksheet Functions 1 November 14th 06 04:32 AM
Highlite a row Red Excel Worksheet Functions 1 October 30th 04 10:52 PM


All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"