bobsburgers
Board Regular
- Joined
- Jun 25, 2017
- Messages
- 60
Hi, all -
I'm trying to develop a macro for asset traceability.
Right now, I'm able to scan the asset (iPad) based on a QR code, and timestamp when it leaves our office - the macro loops until the user stops it, minimizing the need for the use of the mouse or keyboard.
I'm trying to add a function within the macro that would select the cell offset (0,3) from the original value. This is to scan the employee ID card corresponding to the person taking the iPad.
Is there a way to edit my current code to have the scanning done with minimal interference from the mouse or the keyboard? Is there a way to have the macro select the respective cell in Column C, and then looping back to the first message box?
Here is my code:
Please let me know if you can help - thank you!
Best,
bob
I'm trying to develop a macro for asset traceability.
Right now, I'm able to scan the asset (iPad) based on a QR code, and timestamp when it leaves our office - the macro loops until the user stops it, minimizing the need for the use of the mouse or keyboard.
I'm trying to add a function within the macro that would select the cell offset (0,3) from the original value. This is to scan the employee ID card corresponding to the person taking the iPad.
Is there a way to edit my current code to have the scanning done with minimal interference from the mouse or the keyboard? Is there a way to have the macro select the respective cell in Column C, and then looping back to the first message box?
Here is my code:
Code:
Sub iPad_SignOut()
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("A")
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, 1).Value = Now
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_SignOut
End Sub
Please let me know if you can help - thank you!
Best,
bob