Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88868

Using a barcode scanner to search and edit spreadsheet with Visual Basic for Applications

$
0
0

Trying to use a barcode scanner to automatically search a spreadsheet and check it off (routine verifications of assets).

I recorded the macro and it searches a specific string then changes the cell color to "check it off".

How can I make it wait for input from the scanner then search that input instead? I want the "IT2000" to be a variable that changes based on the barcode scanner.

Recored Macro:

Sub Macro1()
'' Macro1 Macro
'' Keyboard Shortcut: Ctrl+b
'
    Sheets("S15-137").Select
    Cells.Find(What:="IT2000", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate
    Selection.Style = "Good"
End Sub


Viewing all articles
Browse latest Browse all 88868


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>