Function =now() in barcode format

mikelib62

New Member
Joined
May 23, 2017
Messages
1
Hi

I am working on a data sheet for users, the idea is to capture the current date & time by scanning an external laminated barcode, there are various activities happening in the room, and, as and when a particular activity is completed, the supervisor scans a barcode (the barcode remains the same), which then puts in the current date & time in that particular cell, the barcode ideally would be a external piece of laminated paper that the user scans every time, however, it should put in the current date and time when the scanning takes place and put that value in the highlighted cell.

Thanks
Mike
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
-Right-click on the sheet tab
-Select View Code from the pop-up context menu
-Paste the code from below into the worksheet's code module
-Change the red value to the value that is returned when you scan the laminated barcode.

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] Worksheet_Change([color=darkblue]ByVal[/color] Target [color=darkblue]As[/color] Range)
    [color=darkblue]If[/color] Target.Count = 1 [color=darkblue]Then[/color]
        [color=darkblue]If[/color] Target.Value = "[COLOR=#ff0000]1234567890[/COLOR]" [color=darkblue]Then[/color] Target.Value = [color=darkblue]Now[/color]
    [color=darkblue]End[/color] [color=darkblue]If[/color]
End [color=darkblue]Sub[/color]
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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