This forum has been moved to TeachExcel.com
Ask all future questions in the New Excel Forum.
ExcelKey
like it didn't wait for the whole bar code which is a string of 10 digits
Private Sub txbScan_Change()
Dim fndScan As Range
If Len(txbScan.Value) >= 10 Then
With Sheets("Sheet1").Columns(1)
Set fndScan = .Find(What:=Me.txbScan.Text, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
If Not fndScan Is Nothing Then
fndScan.Interior.ColorIndex = 4
Else
MsgBox "Scan " & Me.txbScan & " not found."
End If
With Me.txbScan
.Value = ""
.SetFocus
End With
End If
End Sub
Return to Macros and VBA Questions
Users browsing this forum: No registered users and 235 guests