Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Find and select rows based value 1

Status
Not open for further replies.

owentmoore

Technical User
Jul 20, 2006
60
IE
I need to select all rows in an excel worksheet that have a certain value.

The code below will select the last occurence of the value. I haven't been able to modify it to select all occurences and to select all the rows that contain this occurence.

Please - help!!

Code:
Sub Select_Row()
Dim lRow As Long

lRow = Worksheets("Sheet1").Cells.Find(What:="500022116.5920.90", _
      SearchDirection:=xlPrevious, _
      SearchOrder:=xlByRows).Row
    
...select row or multiple rows....
    
End Sub
 
I assume the value can be in one of a number of columns? If a manageable number then this could be done with advanced filter and then using the visible cells property.



Gavin
 
Thanks for the response Gavin.

I've had a look at the advanced filter. It's not clear how I would use this for the purpose I need. Where do I input the value I want to filter for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top