Excel finding and copying

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

goaldy

Thread Starter
Joined
Apr 11, 2004
Messages
1
Hello, i have a product s/sheet of over 2000 products - each product being a row in the s/sheet. Is there such a command to highlight/select the row in which i can specify a unique cell value of a row by using find??
I want to be able to highlight/select the row which has the barcode "xxxxxx" (the product barcode is one the product's values - each product/row has a unique barcode value).

If anyone can help then THANK YOU!!!
 
Joined
Aug 30, 2003
Messages
2,702
You could try a macro. Something like

Sub HighlightRow()
mynum = Application.InputBox("Enter barcode number")
On Error GoTo 1:

Columns("A:A").Select
Selection.Find(What:=mynum, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
ActiveCell.Select
Selection.EntireRow.Select
1:
MsgBox "Number not found."
End Sub

You'd need to specify the relevant column instead of A:A.

Rgds/Happy Easter,
Andy
 
Joined
Aug 30, 2003
Messages
2,702
NB - error handler on this is flawed. I'll fix it tomorrow, or when My Bumper Book of VBA gets in at the library, whichever's sooner.

Rgds/Happy Easter,
Andy
 
Joined
Sep 4, 2003
Messages
4,916
What is the ultimate goal of highlighting these records? Will these highlighted records be copied or cut to somewhere else? If you are simply trying to seperate them from the other records, why not just use an autofilter to produce a seperate list of the records you are interested in?


Rollin
 
Joined
Aug 30, 2003
Messages
2,702
Rollin,

>> What is the ultimate goal of highlighting these records? ...
>> ... why not just use an autofilter ... ?

Could be a fair point given the title of the post, although you'd have to AutoFilter repeatedly for each record you wanted. Even with Custom AutoFilter, you'd be limited to fetching 2 records at a time.

(Data -- Filter -- ) Advanced Filter might be worth a look. You'd just set up the "barcodes to fetch" criteria list first, as per the attached.

NB - to fetch the records straight to a different sheet, the Advanced Filter process must be initiated from that sheet.

Rgds/Happy Easter,
Andy
 

Attachments

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top