Solved how to permanately highlight cells with a scanner in excel

May 11, 2016 at 22:23:59
Specs: Windows 7
I am wondering if there is a way to find cells and permanately highlight them with a barcode scanner.
I have an invoice order of stock I need to mark off, and we are replacing our old system with a new system that doesnt have this function built into it.
I have a column of cells that have a barcode in each one, I need to use the scanner to scan an item and find its barcode in the column and highlight it.
Is this possible?

See More: how to permanately highlight cells with a scanner in excel

Report •


#1
May 12, 2016 at 04:00:25
I don't know anything about what happens when you use a bar code scanner, so maybe you could explain that part. Does it put a value in a cell? Is it always the same cell?

If that's what it does, then it's possible that a Worksheet_Change macro might work. If the macro was monitoring a specific cell, e.g. A1, it could run each time A1 changed and search your list for the new value in A1 and highlight it.

Does that sound like it would work?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
May 12, 2016 at 05:52:38
✔ Best Answer
This code will highlight a value in Column B based on a change to A1. The value must be "entered" in A1. In other words, the code will trigger once the value is placed in A1 and then the tab key or enter key or formula bar "check mark" is applied. I think your bar code scanner should be able to mimic that action.

Private Sub Worksheet_Change(ByVal Target As Range)
 If Target.Address = "$A$1" Then
  With Columns(2)
   Set bc = .Find(Target, lookat:=xlWhole)
    If Not bc Is Nothing Then
     Range(bc.Address).Interior.ColorIndex = 6
    Else: MsgBox "Barcode Not Found"
    End If
  End With
 End If
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions


Ask Question