Tech Support Guy banner
Status
Not open for further replies.
1 - 5 of 5 Posts

· Registered
Joined
·
1 Posts
Discussion Starter · #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!!!
 

· Registered
Joined
·
2,708 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
 

· Registered
Joined
·
2,708 Posts
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
 

· Registered
Joined
·
4,936 Posts
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
 

· Registered
Joined
·
2,708 Posts
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

1 - 5 of 5 Posts
Status
Not open for further replies.
Top