How to enter the date and time for barcode scans in Excel



How to enter the date and time for barcode scans in Excel
Enter date and time when a value is entered. How to format the date. How to enter the date with the time. Check out my online courses

Become an Affiliate and earn 25% on Course Sales

For more help visit my website or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Excel one-on-one on-line training available. Email me to arrange.

I am able to provide online help on your computer at a reasonable rate.

Check out my next one-hour Excel Webinar

I use a Blue condensor Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

If you need to buy Office 2019 follow

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
Dim x As Integer
For x = 2 To 100
If Cells(x, 1).Value (symbolfor not equal to) “” And Cells(x, 2).Value = “” Then
Cells(x, 2).Value = Date & ” ” & Time

Cells(x, 2).NumberFormat = “m/d/yyyy h:mm AM/PM”
End If
Next
Range(“B:B”).EntireColumn.AutoFit

End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
20 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
A T

Thank you!!!
It was the first step saving me 🙂

Khaled saifulla

For x = 2 To 100 – when i try increase the range its not working showing runtime error'6' overflow.. how can i solve this?

Alex Smith

How about if I scan the barcode the item name will appear and it’s price
Thank you

ken kaneki

what if the barcode scan is more than 2 on vba?

MUHAMMED RASHID K P

am using a barcode scanner to read in barcode numbers into excel. But > everytime after I scan a barcode, excel moves to the cell in the next row. > What I want is moves down to the next column. > Anyone with information please help.

Eren Yilmaz

thank you so much!!! i clicked on every link…..! i hope it helps you!

Bart Bonnyns

Nice! Thanks Barb!

Momento Eléctrico

THANKS, IF I WANT I COLUMN A DATE AND COLUMN B BARCODE. HOW DO I DO THAT?

Technical Pahadi

Very good
Love you

Ankur Sharma

Hi
This code is working on manual entries but when I scan barcodes by add-ins in excel it is not showing the time and date.
Please help

darthjay71

Hi Barb, this is terrific and extremely helpful. How would I make it so instead of it moving to the next empty row it went to the next column for another barcode entry and then 1 more entry, then it would return to the next empty row?

Ashraf Elsawy

HI I NEED AUTOMATIC SUM QYT OF barcode (In case the code repeats the quantity

Gideon deBeer

Hello Barb, i have 2 sheets . Sheet 1 my " Donnie" and sheet 2 "DDATA" .I Scan on sheet Donnie block A1 andBarcode should appear on A1 sheet DDATA then date and time in block B making up 1 unit,If i scan the same barcode again it fills block C on sheet. DDATA ( VBA sheet 5 ) ON THE LIST AT THE VBA Project My Donnie is sheet 5 and DDATA is sheet 3 . I use this code in sheet VBA 3 Donnie:

Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub

If Target = "" Then Exit Sub

Dim w2 As Worksheet, bcr As Range, nr As Long, nc As Long, n As Long

With Application

.EnableEvents = False

.ScreenUpdating = False

Set w2 = Sheets("Sheet5")

With w2

n = Application.CountIf(w2.Columns(1), Target.Value)

If n = 0 Then

nr = w2.Cells(w2.Rows.Count, "A").End(xlUp).Row + 1

If nr = 2 And w2.Range("A1") = vbEmpty Then

nr = 1

End If

w2.Range("A" & nr) = Target.Value

w2.Range("B" & nr) = Now()

w2.Range("B" & nr).NumberFormat = "mm/dd/yyyy hh:mm:ss AM/PM"

w2.Columns("A:B").AutoFit

ElseIf n > 0 Then

nr = w2.Cells(w2.Rows.Count, "A").End(xlUp).Row + 1

If w2.Cells(nr, 1).Value = Target.Value Then

nc = w2.Cells(1, Columns.Count).End(xlToLeft).Column + 1

w2.Cells(1, nc) = Now()

w2.Cells(1, nc).NumberFormat = "mm/dd/yyyy hh:mm:ss AM/PM"

w2.Columns(nc).AutoFit

Else

Set bcr = w2.Columns(1).Find(Target.Value, LookAt:=xlWhole)

nc = w2.Cells(bcr.Row, Columns.Count).End(xlToLeft).Column + 1

w2.Cells(bcr.Row, nc) = Now()

w2.Cells(bcr.Row, nc).NumberFormat = "mm/dd/yyyy hh:mm:ss AM/PM"

w2.Columns(nc).AutoFit

End If

End If

End With

Target.Clear

.EnableEvents = True

.ScreenUpdating = True

End With

End Sub

I get a error at : " Set w2 = Sheets("Sheet5")
"
Please Help

Amir Azren

Thanks a lot

Jun Kuma

This helped a lot, thank you!

Victor Fernandez

Useful, thanks!!

Nelson Rahi

Amazing, thank you so much!

Sarah Preston

you are awesome and I love you. thanks!!!!!

Edward Nguyen

I get an "Only comments may appear after End Sub, End Function, or End Property" error when I try to run this macro. What am I doing wrong?

Ismail Ismaili

thank you so much teacher i really was looking for this.