Previous in Forum: Setting Up Mailing List   Next in Forum: Mac Floppy Disk to CD
Close
Close
Close
7 comments
Rate Comments: Nested
Guru
Engineering Fields - Manufacturing Engineering - New Member Hobbies - Target Shooting - New Member United States - Member - New Member Hobbies - Hunting - New Member

Join Date: Dec 2006
Location: Charlotte, NC USA
Posts: 791
Good Answers: 17

Time Stamp in Excel

09/21/2010 11:37 AM

My boss wants me to track set up times using an excel spreadsheet. I think he wants me to make a sheet and have the guys type in the time they started and then the time the set up was finished.

I would like to know if anyone knows how to automatically time stamp an entry into excel. I first tried an "IF" statement tied to the "NOW()" command, that worked OK, but when I typed in my stop, the "NOW()" command updated both entries...

anyone know how to make the "NOW()" command one time per cell?

Laby

__________________
Be careful of what you wish for .....
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
2
Active Contributor
United States - Member - New Member Engineering Fields - Electrical Engineering - New Member

Join Date: Jun 2010
Location: Troy, NY
Posts: 21
Good Answers: 1
#1

Re: Time Stamp in Excel

09/21/2010 4:31 PM

Is the problem that your NOW() command keeps updating the new time in the workbook when you want a certain time to be stored? If so, see the first part of this:

http://www.pcworld.com/article/105312/who_knew_excel_could_do_that_ten_top_tips.html

Register to Reply Good Answer (Score 2)
Guru
Engineering Fields - Manufacturing Engineering - New Member Hobbies - Target Shooting - New Member United States - Member - New Member Hobbies - Hunting - New Member

Join Date: Dec 2006
Location: Charlotte, NC USA
Posts: 791
Good Answers: 17
#2
In reply to #1

Re: Time Stamp in Excel

09/22/2010 7:52 AM

Thank you, that is very useful but I was looking for some way to have it automated for the guys on the floor, most of those guys can't tell a mouse from a keyboard, so I have to do things that make it easy for them.

Here's what I was looking for, if I go to C3 and make that a pull down menu where they can select "Start" or "Stop" then in D3, the cell will automatically populate the date and time.

The "NOW()" would work fine, if it didn't update every time the spreadsheet updates.

Wonder if there is someway to put those key strokes in a macro???? ummmm

__________________
Be careful of what you wish for .....
Register to Reply
Power-User

Join Date: May 2008
Posts: 166
Good Answers: 5
#6
In reply to #1

Re: Time Stamp in Excel

09/22/2010 2:37 PM

This is a good answer (ie: To insert a fixed date into a cell--a date that you don't want to change--hold down Ctrl while you press the semicolon ( ;) key. To insert the current time (without a date), press Ctrl-Shift-Semicolon.)

provided you turn this into a macro with a button or by assigning a shortcut key to keep it simple for the non-computing types :)

__________________
All we want are the facts, ma’am.” Sgt Joe Friday, "Dragnet"
Register to Reply Score 1 for Good Answer
Associate

Join Date: Apr 2010
Location: Chicago's western suburbs
Posts: 35
Good Answers: 2
#7
In reply to #6

Re: Time Stamp in Excel

09/23/2010 3:39 PM

GA to sbruel@yahoo.com. It solves the problem exactly and with minimal fuss.

QL

__________________
"When in doubt - check it out!"
Register to Reply
Guru
Technical Fields - Project Managers & Project Engineers - New Member

Join Date: Aug 2006
Location: Midwestern United States
Posts: 843
Good Answers: 76
#3

Re: Time Stamp in Excel

09/22/2010 8:42 AM

As I'm sure you now know through experimentation, the 'now' command wont meet your needs. Having a novice computer user select a drop-down would be no more difficult than setting a 24-hour format clock next to the computer and having them enter the date and time directly.

If you wanted to get fancy, on your end… set up a protected spreadsheet with the first tab simply a macro button that invokes the 'now' command and copies the data and pastes special 'value only'. When they are done, they click the macro button again and it repeats.

Another option, if the machine they are setting up has a PLC, just add a push button on the machine somewhere that on first press starts a timer in the PLC. When they are done, they press the button again and it stops the timer and writes the data to a log file. You can then query the log once a week and dump the data to a spreadsheet yourself.

But, in my opinion, setting a three-column spreadsheet with 'date,' 'start,' and 'stop' columns that they type the data in directly is not that complicated and even the most novice of users would be able to do with very little training.

But, if you're worried about data manipulation… I'd say a modified version of the PLC version above. Tie in a timer to the first process they do at the beginning of the setup (operator sets machine to stand-by) that stops once they begin the first post-setup process (operator sets machine to ready).

If you do a complete lock-out of the machine, PLC and all, then have the PLC log the time as the last controlled process is implemented prior to throwing the main breaker. Then, have the PLC log the time as its first process upon start-up.

Regardless, there are quite a few different ways to track time… it's just that the 'now' command probably isn't one of the best options.

JavaHead

__________________
Reuters - Investigators found that the recent thread derailment in CR4 was caused by over-weight creatures of lore and request that membership DON'T FEED THE TROLLS.
Register to Reply
Commentator

Join Date: May 2008
Location: St. Paul , MN
Posts: 79
Good Answers: 6
#4

Re: Time Stamp in Excel

09/22/2010 9:38 AM

You can set up a function in vba that writes to a cell on workbook startup and shutdown.

As an example the code in the ThisWorksheet module could read. This assumes cell A1 on sheet1 holds the number of times the workbook has been opened.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim numTimesStarted as int = Sheet1.Cells(1,1).value
Sheet1.Cells(numTimesStarted, 2).Value = Now()
End Sub

Private Sub Workbook_Open()

Dim numTimesStarted as int = Sheet1.Cells(1,1).value
Sheet1.Cells(numTimesStarted, 1).Value = Now()

Sheet1.Cells(1,1).value = numTimesStarted + 1
End Sub

Search the web for excel and vba for more information.

Register to Reply
Anonymous Poster
#5

Re: Time Stamp in Excel

09/22/2010 12:11 PM

Don't know that much about VBA but why not use the NOW() command as part of a macro that then converts the value to text. Then it won't be updated.

Register to Reply
Register to Reply 7 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Anonymous Poster (1); Daddio926 (1); JavaHead (1); Labyguy (1); mcgratp45 (1); sbruel (1); TLC Designer (1)

Previous in Forum: Setting Up Mailing List   Next in Forum: Mac Floppy Disk to CD

Advertisement