check in- check out sytem using a barcode scanner

ccarrillo54

New Member
Joined
Nov 29, 2018
Messages
2
Hello, I'm trying to create a check in/out system at a lab I work at. I'm not to experienced and using VBA. I was able to tinker with some formulas to get it to do what I wanted, but I wasn't fully successful in getting all the steps I wanted done. so what I'm trying to do is check in samples using a barcode followed by a date in the cell right next to it. I want this formula to apply to A2000 so I can check in multiple samples. im using an input box and I want this input box to be able to detect matched samples and place them in the checked out column "C" followed by a date in the cell right next to it. I would appreciate any help you guys can give me. Here's the code I am currently using.




Private Sub Worksheet_Activate()

Dim myValue As Variant
Dim code As Variant
Dim matchedCell As Variant

myValue = InputBox("Please scan a barcode")
Range("A2").Value = myValue
Set NextCell = Cells(Rows.Count, "A").End(xlUp)
If NextCell.Row > 1 Then NextCell = NextCell.Offset(1, 0)
Set matchedCell = Range("a2:a2000").Find(what:=code, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=True)
If myValue = True Then Paste ("C2;C2000")
If Not matchedCell Is Nothing Then matchedCell.Offset(-1, 1).Value = Now

End Sub


A B C D


CHECKED INDATECHECKED OUTDATE
4000-18-1128-111/29/2018 11:03
<colgroup><col width="215" style="width: 161pt;" span="4"> <tbody> </tbody>
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,215,724
Messages
6,126,485
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top