Insert Functions

R

reset

Hello,

I need to insert the current time and date into excel when a barcode is
scanned from an ID card. It requires the [ "ctrl" + "shift" + ";" ] for
which I can't find an ansii code for the latter or how to input the
combination.. Any ideas how I can put this into the code so it will output
to excel when the card is scanned. Also, it would be nice at the end of the
code to get the focus to go to the next row, first column after a scan, to
be ready for the next card. Any help is greatly appreciated.

David A. Powell
 
D

David McRitchie

Hi David,
I've never used a bar code reader, but it should be like keying
in the data and as such an Event macro would should work.
http://www.mvps.org/dmcritchie/excel/event.htm#datetimestamp

However since you are coding a macro anyway for the barcode
reader, which Frank picked up better simply use his suggestion
and for the second part of your request.
cells(activecell.row+1, 1).select

should not apply to you, but after a manual entry you might have
dropped down to the next row, in which case:
cells(activecell.row, 1).select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Frank Kabel said:
Hi
in VBA why not use something like
activecell.value = now

--
Regards
Frank Kabel
Frankfurt, Germany
reset said:
Hello,

I need to insert the current time and date into excel when a barcode is
scanned from an ID card. It requires the [ "ctrl" + "shift" + ";" ] for
which I can't find an ansii code for the latter or how to input the
combination.. Any ideas how I can put this into the code so it will output
to excel when the card is scanned. Also, it would be nice at the end of
the code to get the focus to go to the next row, first column after a
scan, to be ready for the next card. Any help is greatly appreciated.

David A. Powell
 
R

reset

Thanks, Frank and David...I hope to be able to test this soon. I will be
using a static time to be able to have scan in and scan out times, which I
found in David's links. Now I will work on writing a macro in VBA. First
time always has me nervous.

David A. Powell


David McRitchie said:
Hi David,
I've never used a bar code reader, but it should be like keying
in the data and as such an Event macro would should work.
http://www.mvps.org/dmcritchie/excel/event.htm#datetimestamp

However since you are coding a macro anyway for the barcode
reader, which Frank picked up better simply use his suggestion
and for the second part of your request.
cells(activecell.row+1, 1).select

should not apply to you, but after a manual entry you might have
dropped down to the next row, in which case:
cells(activecell.row, 1).select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Frank Kabel said:
Hi
in VBA why not use something like
activecell.value = now

--
Regards
Frank Kabel
Frankfurt, Germany
reset said:
Hello,

I need to insert the current time and date into excel when a barcode is
scanned from an ID card. It requires the [ "ctrl" + "shift" + ";" ]
for
which I can't find an ansii code for the latter or how to input the
combination.. Any ideas how I can put this into the code so it will
output
to excel when the card is scanned. Also, it would be nice at the end of
the code to get the focus to go to the next row, first column after a
scan, to be ready for the next card. Any help is greatly appreciated.

David A. Powell
 
D

David McRitchie

Hi David,
Frank gave you VBA for a date and time timestamp
in VBA you are using the VBA function NOW to create
a constant in a cell. Use of NOW() in a worksheet formula
would change upon recalculation. Note the difference between
creating a constant in code and using a formula in a worksheet.

In Excel and in PC usage in general a date is measured in
days past a certain date and time is measured as fractional
days so they both exist in a floating point number and take
no more room than if only one is present. You can read more
about date and time at
http://www.mvps.org/dmcritchie/excel/datetime.htm

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

reset said:
Thanks, Frank and David...I hope to be able to test this soon. I will be
using a static time to be able to have scan in and scan out times, which I
found in David's links. Now I will work on writing a macro in VBA. First
time always has me nervous.

David A. Powell


David McRitchie said:
Hi David,
I've never used a bar code reader, but it should be like keying
in the data and as such an Event macro would should work.
http://www.mvps.org/dmcritchie/excel/event.htm#datetimestamp

However since you are coding a macro anyway for the barcode
reader, which Frank picked up better simply use his suggestion
and for the second part of your request.
cells(activecell.row+1, 1).select

should not apply to you, but after a manual entry you might have
dropped down to the next row, in which case:
cells(activecell.row, 1).select
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

Frank Kabel said:
Hi
in VBA why not use something like
activecell.value = now

--
Regards
Frank Kabel
Frankfurt, Germany
Hello,

I need to insert the current time and date into excel when a barcode is
scanned from an ID card. It requires the [ "ctrl" + "shift" + ";" ]
for
which I can't find an ansii code for the latter or how to input the
combination.. Any ideas how I can put this into the code so it will
output
to excel when the card is scanned. Also, it would be nice at the end of
the code to get the focus to go to the next row, first column after a
scan, to be ready for the next card. Any help is greatly appreciated.

David A. Powell
 
Top