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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
-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,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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