print a static date from a barcode

  • Thread starter Thread starter Dennis Pedersen
  • Start date Start date
D

Dennis Pedersen

Hello,
Im creating a very simple track and trace system for use only to my own
packages.

And i need excel to type todays date when it reads a barcode. And the date
needs to be static.

Any ideas on how to do this? - im not the big programmer så im lost :)
As far as i can see it can not be done "out of the box". I cant find any
barcode that could give me CTRL+SHIFT+; (static date).

So im looking for another way of doing it :)


Regards,
Dennis
 
Do you mean enter the current date instead of the read barcode, or enter the
date in a cell next to the barcode entry ?

How do you currently read the barcode? Select a cell and then scan, or what?

Most posters here (inc. myself) may not be too familiar with barcodes, so
you could provide more details there.

I'm thinking you could use the worksheet_change event, but it depends on how
"general" you want this feature to be (one specific workbook?)

Tim
 
Tim Williams said:
Do you mean enter the current date instead of the read barcode, or enter
the date in a cell next to the barcode entry ?

How do you currently read the barcode? Select a cell and then scan, or
what?

Most posters here (inc. myself) may not be too familiar with barcodes, so
you could provide more details there.

I'm thinking you could use the worksheet_change event, but it depends on
how "general" you want this feature to be (one specific workbook?)


When i am filling out my return.xls - instead of typing Name,date,package
number. I just want to scan the barcodes on a paper i have. The scanner just
works as a USB keyboard (with the limitation i can only type
"123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-.*$/+%").
When i scan a barcode it enterns the value in the current field in excel

Therefore i need a combination of the above caracters that could give me
static version of the date today.

Since i cant get it out of the box i am open to any ideas on how excel can
convert the caracters above to the date.

Hope that clears thing up a bit


Regards,
Dennis
 
You mean a single barcode which when scanned would always enter as the
current date ?

Try this - the code goes into the sheet module, which you can access by
right-clicking on the sheet tab and selecting "view code"
You'd create a barcode with content of "$DATE$" and when scanned to the
sheet it should be replaced with the current date.


'*******************************************
Private Sub Worksheet_Change(ByVal Target As Range)

Const DATE_FLAG As String = "$DATE$"

If Target.Areas.Count = 1 Then
If Target.Cells.Count = 1 Then

If Target.Value = DATE_FLAG Then
Target.Value = Format(Now, "mm/dd/yyyy")
End If

End If
End If

End Sub
'*******************************************

Tim
 
Tim Williams said:
You mean a single barcode which when scanned would always enter as the
current date ?

yep.
And the date needs to be static so it does not change the next time i open
the doc.

Try this - the code goes into the sheet module, which you can access by
right-clicking on the sheet tab and selecting "view code"
You'd create a barcode with content of "$DATE$" and when scanned to the
sheet it should be replaced with the current date.

Ill try that - thank you.



Regards,
Dennis
 
Tim Williams said:
Try this - the code goes into the sheet module, which you can access by
right-clicking on the sheet tab and selecting "view code"
You'd create a barcode with content of "$DATE$" and when scanned to the
sheet it should be replaced with the current date.


'*******************************************
Private Sub Worksheet_Change(ByVal Target As Range)

Const DATE_FLAG As String = "$DATE$"

If Target.Areas.Count = 1 Then
If Target.Cells.Count = 1 Then

If Target.Value = DATE_FLAG Then
Target.Value = Format(Now, "mm/dd/yyyy")
End If

End If
End If

End Sub

I just found the barcode reader and tryed it - works like a charm
Thanks again.



Regards,
Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top