Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and select all


How do I get this:
Cells.Find(What:="bilbobaggins", After:=ActiveCell
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows
SearchDirection:=xlNext, _
MatchCase:=False).Activate
To select all matching cells at the same time

--
rbmccle
-----------------------------------------------------------------------
rbmcclen's Profile: http://www.excelforum.com/member.php...fo&userid=3636
View this thread: http://www.excelforum.com/showthread.php?threadid=56159

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Find and select all

Try this...

Sub FindAll()
Dim rngFound As Range
Dim rngFoundAll As Range
Dim strFirstAddress As String
Dim wks As Worksheet
Dim rngToSearch As Range

Set wks = Sheets("Sheet1")
Set rngToSearch = wks.Cells
Set rngFound = rngToSearch.Find(What:="bilbobaggins", _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
MatchCase:=False)
If rngFound Is Nothing Then
MsgBox "Sorry, Not found..."
Else
Set rngFoundAll = rngFound
strFirstAddress = rngFound.Address
Do
Set rngFoundAll = Union(rngFound, rngFoundAll)
Set rngFound = rngToSearch.FindNext(rngFound)
Loop Until rngFound.Address = strFirstAddress
wks.Select
rngFoundAll.Select
End If
End Sub
--
HTH...

Jim Thomlinson


"rbmcclen" wrote:


How do I get this:
Cells.Find(What:="bilbobaggins", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows,
SearchDirection:=xlNext, _
MatchCase:=False).Activate
To select all matching cells at the same time?


--
rbmcclen
------------------------------------------------------------------------
rbmcclen's Profile: http://www.excelforum.com/member.php...o&userid=36367
View this thread: http://www.excelforum.com/showthread...hreadid=561595


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and select all


Exactly what I need, it works perfectly!

If you are ever in San Antonio I'll buy you a sod

--
rbmccle
-----------------------------------------------------------------------
rbmcclen's Profile: http://www.excelforum.com/member.php...fo&userid=3636
View this thread: http://www.excelforum.com/showthread.php?threadid=56159

Reply
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 & Select Celeste[_2_] Excel Discussion (Misc queries) 3 December 1st 09 05:52 PM
find & select Aaron Hodson \(Coversure\) Excel Worksheet Functions 2 August 21st 08 08:36 AM
Find and Select Judd Jones[_2_] Excel Programming 2 December 29th 04 06:09 PM
Find All.... Then Select All Jason Excel Programming 2 November 7th 04 07:52 PM
Find then select to the right JUAN Excel Programming 2 April 30th 04 09:49 PM


All times are GMT +1. The time now is 09:52 PM.

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

About Us

"It's about Microsoft Excel"