#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 150
Default vb code question

I have 3 columns that have data of which column A has the criteria I want to
search for. Once found, I want to select columns A, B, and C that match the
search criteria ( in this case "7760").

The code below allows me to find the criteria and select columns A, B, and C
although I don't know how to tell it to find all rows that match the criteria
in column A. In other words, I don't know how to tell it to go to the last
row that has 7760 in column A.

If you can assist I would be more than greatful! Many thanks!


Dim rng As Range
Cells(1, 1).Select
Set rng = Range("A1:IV65400").Find(What:="7760", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
If Not rng Is Nothing Then
ActiveCell.End(xlDown).Offset(0, 3).Select
End If
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
question on VB code peyman Excel Discussion (Misc queries) 6 October 22nd 07 11:47 PM
Another code question M&M[_2_] Excel Discussion (Misc queries) 3 August 9th 07 10:00 PM
VB Code Question Stan Excel Discussion (Misc queries) 2 May 2nd 07 10:13 PM
VB Code Question Stan Excel Discussion (Misc queries) 6 April 30th 07 11:27 PM
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM


All times are GMT +1. The time now is 10:49 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"