Tech Support Guy banner

Excel finding and copying

965 Views 4 Replies 3 Participants Last post by  XL Guru
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!!!
Status
Not open for further replies.
1 - 3 of 5 Posts
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
See less See more
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
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

See less See more
1 - 3 of 5 Posts
Status
Not open for further replies.
Top