bobsburgers
Board Regular
- Joined
- Jun 25, 2017
- Messages
- 60
Hello again, all!
Is there a way to modify the below code so that instead of have to push the button for every entry, I could simply activate the "Item Return" macro, scan in multiple entries, and then "turn-off" the macro - so to speak.
The point of the software is to track items going in and out of our location. Each item is assigned to a "No charge form," some of which have multiple items. I would like the macro to loop back to the "item return" dialogue box after the function has been run once, rather than just finishing. Is this possible?
Thanks again for all of the help!!
Best,
Bob
Is there a way to modify the below code so that instead of have to push the button for every entry, I could simply activate the "Item Return" macro, scan in multiple entries, and then "turn-off" the macro - so to speak.
Code:
Sub Item_Return()
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")
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
End Sub
The point of the software is to track items going in and out of our location. Each item is assigned to a "No charge form," some of which have multiple items. I would like the macro to loop back to the "item return" dialogue box after the function has been run once, rather than just finishing. Is this possible?
Thanks again for all of the help!!
Best,
Bob