time in and out

KoonAik

New Member
Joined
Oct 1, 2006
Messages
6
I'm trying to create an application to indicate booking in and out. i need to have a time that is always running in a cell. then everytime i scan a barcode, it captures the time and puts into the number in a cell and the time that was scan into another. I'm quite new in vba.

Would really appreciate any form of help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You should not need to keep a running time... the operating system is doing that for you. When you scan in a barcode on the event trigger you can check the system clock... When the sub below is run it will show you the current time in military format. Not quite sure exaclty what you are trying to do, but this should help you with the time piece.

Code:
Public Sub test_time()

    MsgBox Format(Now(), "hh:mm")

End Sub
 
Upvote 0
Sounds similar to something I've done. I created a spreadsheet to record stock movements, which writes date and time to a worksheet like this:

Code:
Sub EasyTime ()

Range("A1")= Date$ ' Today's Date
Range("A2")= Time$ ' Current time

End Sub

Any good to you?
 
Upvote 0
Thanks Guys!! I was away for like 4 days. Really thanks alot. both the code was useful, but i also need to display a time that runs. That's why i needed the code.
 
Upvote 0
Keeping a clock running on the spreadsheet isn't too practical, at least as far as I know. My best guess would be to use a function triggered by OnTime or similar to write the current system time to a worksheet cell. It's not something I've done in the past so I can't give any specific guidance.

The book-in time is written to the sheet when you scan the booked item's barcode. Can't you just use the system clock to see what the time is?

If I've misunderstood the problem, please enlighten me... but I'm unsure why the spreadsheet needs a clock.
 
Upvote 0
Hello,

It's not the best idea to run time in a cell. Better would be to use a textbox.

Feel free to send me an email (see email-button below my posts), subject "time running in cell" & "... in textbox", I'll send you an example for both methods. You can check out if you like it and implement into your workbook.

kind regards,
Erik
 
Upvote 0
Thanks Guys

Thanks alot guys! I think i will forego the running time after all your advice!
Currently, I doing this checking in system for my office. that's why i need the running time. i need to generate a new spreadsheet everyday, with some textbox(code embedded). Is it possible to generate some new spreadsheet without having a new textbox, but still using the same textbox to check in and out.
 
Upvote 0
some questions
what do you want to do with this textbox ? what is "to check in and out" ? how do you translate this in Exel-language ?
how is the new spreadsheet generated ?
spreadsheet = sheet in same workbook ? (not new workbook)
probably offline for a day
 
Upvote 0
This sounds familar... are you working in a warehouse/stock control environment?

I'm guessing you'd like a spreadsheet for booking items in and out of your control. This spreadsheet needs to record the item numbers taken from the barcodes you scan and write them to a spreadsheet along with the date and time you scanned them. The spreadsheet will generate a new sheet for every day, and each day's scan's will be written to it's own sheet.

Am I right?

[edited for missing apostrophes]
 
Upvote 0
I'll assume my above post was correct. I'm unsure whether a new sheet for each day is the best idea; you could end up with 100+ sheets relatively soon.

Alternately, you could write 'in' items to one sheet, 'out' items to another and use a Vlookup between the two to derive the number and barcodes of all item in your possession. That's my preferred approach anyway. If you need to know what items moved on a particular day, use autofilter.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,986
Members
448,538
Latest member
alex78

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