bobsburgers
Board Regular
- Joined
- Jun 25, 2017
- Messages
- 60
Hi, all!
I'm working on a program that would track iPads used by our employees.
Ideally, the system would allow me to press a button to activate a search VBA, scan a bar code on the iPad and once the scanstring is located (in column A), allow me to scan an employee's ID card to populate the adjacent cell (column B) with the employee's ID number. This would then loop back to scan an iPad until the message box is manually closed.
So far, I have been able to come up with some code that allows me to find the correct iPad ID through QR codes, however, I can't seem to find a way to have the macro prompt a second message box asking for the Employee ID Number.
Would it be possible to help me find a way to have this macro contain both the "find the iPad" function, as well as automatically prompting a new message box asking for the Employee ID Number?
Here is the code I have so far:
Please let me know if you can provide any insight - thanks!
best,
bob
I'm working on a program that would track iPads used by our employees.
Ideally, the system would allow me to press a button to activate a search VBA, scan a bar code on the iPad and once the scanstring is located (in column A), allow me to scan an employee's ID card to populate the adjacent cell (column B) with the employee's ID number. This would then loop back to scan an iPad until the message box is manually closed.
So far, I have been able to come up with some code that allows me to find the correct iPad ID through QR codes, however, I can't seem to find a way to have the macro prompt a second message box asking for the Employee ID Number.
Would it be possible to help me find a way to have this macro contain both the "find the iPad" function, as well as automatically prompting a new message box asking for the Employee ID Number?
Here is the code I have so far:
Code:
Sub iPad_Out()
Dim scanstring As String
Dim foundscan As Range
Dim ws As Worksheet
Dim foundscan_address As String
Set ws = ActiveSheet
scanstring = InputBox("Please enter a value to search for", "Enter value")
If scanstring = "" Then Exit Sub
With ws.Columns("D")
Set foundscan = .Find(What:=scanstring, LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not foundscan Is Nothing Then
foundscan_address = foundscan.Address
Do
foundscan.Offset(0, 4).Value = scanstring
ws.Activate
foundscan.Activate
ActiveWindow.ScrollRow = foundscan.Row
Set foundscan = .FindNext(foundscan)
Loop While Not foundscan Is Nothing And foundscan.Address <> foundscan_address
Else
MsgBox scanstring & " was not found"
End If
End With
Call iPad_Out
End Sub
Please let me know if you can provide any insight - thanks!
best,
bob