Macro for scanning QR codes

Jak68

New Member
Joined
Jan 21, 2016
Messages
17
Hi, I have a spreadsheet with a few hundred items on it and these items are occiasonally getting sent out and then returning to me and I want to to book them in and then out so I know what is happening.
I currently have a tab with all of the items on it and then I have created a new tab for booking these items in.

Ideally I would like to scan the QR code which has a unique id number and then the scan will transfer the unique id into a cell, then the next column (column 'B') to show the date and time when the scan happens, when the items returns I would like to scan the QR code again to book the item back in with the date and time (column 'C')

I currently have a macro which works ok but I wanted it to work automatically if possible as I currently scan the QR code into cell E1 and then press control 'L', this then puts the unique id into column 'A' if not already there and the date and time into column 'B' and then if the unique id is referenced in column 'A' it will put the date and time into column'C' next to the correct id.

Here is the macro that is generated, is it possible to change this so I can just scan the QR code putting the date and time automatically when booking in and out but keeping the information next to each other

Hope this makes sense :eeek:

Code:
Sub ScanTag()
Dim x As Integer
Dim isnew As Boolean


isnew = True


For x = 3 To 300
If Cells(x, 1).Value = Cells(1, 5).Value Then
isnew = False
Cells(x, 3).NumberFormat = "dd/mm/yyyy h:mm AM/PM"
Cells(x, 3).Value = Date & "   " & Time
Exit For
End If
If Cells(x, 1).Value = "" Then
Exit For
End If
Next
If isnew Then
Cells(x, 1).Value = Cells(1, 5).Value
Cells(x, 2).Value = Date & "   " & Time
End If


End Sub

Cross posted https://www.excelforum.com/excel-programming-vba-macros/1264952-macro-for-scanning-qr-codes.html
 
Last edited by a moderator:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I have been doing a bit of digging and found a macro that is virtually what I need, but it does not search column 'A' for the ID, it looks like it will need to look for the ID and then click on that cell and then scan the QR code for the date and time, I was hoping to find something that you can just click in one place and then scan the qr code it will then put a date/time in.

Here is the macro I found:

http://www.mrexcel.com/forum/excel-questions/672492-scan-barcode-excel-date-time-stamp-out.html
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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