Forum Discussion
Pip_Payne
Oct 17, 2022Copper Contributor
Macro to move to another cell after entering date
I have a macro that scans a barcode, looks for the barcode in column A then if found moves across 15 columns & puts the date & time.
I'd like it to then move back 11 columns & select the cell ready for data input by the user
Sub Findbarcodesetdate()
Dim code As Variant
Dim matchedCell As Variant
code = InputBox("Please scan a barcode and hit enter if you need to")
Set matchedCell = Range("A2:A5000").Find(what:=code, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=True)
If Not matchedCell Is Nothing Then matchedCell.Offset(0, 15).Value = Now()
End Sub
1 Reply
Sort By