Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 02-27-2008, 04:40 PM   #1 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Time Stamp Multiple Cells in Excel

I setup a word name "clock" to =TEXT(NOW(),"h:mm AM/PM") so I can have a timestamp entered when someone types "clock", however, the problem is if someone typed it right now it would read 6:34 in cell A1 then tomorrow they typed it in the same sheet in cell B1 it would display tomorrows time and change A1 automatically to that time stamp. How can I make it to what time gets stamped on stays on. This is for an electronic time card that I am working on.

Thank you!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 02-28-2008, 01:53 PM   #2 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Hi again

You are using the NOW() function which is volatile - in other words it updates each time the spreadsheet is opened or re-calculated. You need to use Date or Time. I'm pretty hopeless at formulae so I'm not sure the best way to do that. Could do it easily in code of course...
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-29-2008, 07:04 AM   #3 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

I think I am going to do it in code, I have it working in cells adjacent to a cell with a value in it which may work out best.

For example; to clock in you would put a X in cell C6 and then in cell D6 it would display the time.

Here is the code I am using...

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("C6:C12,E6:E12,G6:G12,I6:I12"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "hh:mm"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub

What is the best way to also add the below code to this, the code you helped me with before,

Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("F9:F15,F21:F27,G9:G15,G21:G27,H9:H15,H21:H27,I9:I15,I21:I27")) Is Nothing Then Exit Sub
Sheets("Sheet1").Unprotect
If Target.Value <> "" Then
Target.Locked = True
End If
Sheets("Sheet1").Protect
End Sub

Thank you!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-29-2008, 07:36 AM   #4 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

Wow I am making this very complicated but I have one more code I need help with and need to know how to incorporate it within that sheet.

Basically I have dates in cells A6:A12 and what i am trying to do is to have certain cells unlock if the date in one of those cells = TODAY

for example,

If A6 = TODAY then Unprotect C6,E6,G6,I6
ELSE PROTECT C6,E6,G6,I6

But i need this same idea to search and find todays date betwee A6:A12. The reason is so someone can only update their time card on the correct day. So if today is Friday 2.29.08, I can only put my X (to timestamp entry) in todays row. If I were to click on tomorrows date it wouldn't let me enter anything until tomorrow.

Thank you!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 02-29-2008, 03:30 PM   #5 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

I'll try and look at this over the weekend and get back to you. I think the wife has some kind of shopping trip planned...
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-01-2008, 06:58 AM   #6 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

I appreciate all your help. Good luck with the shopping trip, my wife seems to drag me along on one of those every weekend...
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-01-2008, 03:46 PM   #7 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Hi again

See if this works for you. A couple of things to point out. I noticed you had used NOW in your first code - as I said earlier, this a Volatile function that will update, so I changed that to the Time function, which simply uses the system time. Since you can only have one Change Event on any sheet, I created a separate sub for A6:A12 - it is called from the main change event. Note that you will need to format the cells in A6:A12 to the second format type in the date section of the format box i.e *14 March 2001, otherwise the sub will not recognise the text. Since there were only 6 cells involved, it's probably easier to loop through those six and test each value.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A6:A12")) Then Call CheckTheDate

If Intersect(Target, Range("C6:C12,E6:E12,G6:G12,I6:I12,F9:F15,F21:F27,G9:G15,G21:G27,H9:H15,H21:H27,I9:I15,I21:I27")) Is Nothing Then Exit Sub

Sheets("Sheet1").Unprotect
With Target
If .Count > 1 Then Exit Sub
Application.EnableEvents = False
If IsEmpty(.Value) Then
    .Offset(0, 1).ClearContents
        Else
            With .Offset(0, 1)
                .Value = Format(Time, "hh:mm")
                .Locked = True
            End With
End If
End With
Sheets("Sheet1").Protect
Application.EnableEvents = True
End Sub


Sub CheckTheDate()
Dim myRng As Range
Dim c As Range

Set myRng = Sheets("Sheet1").Range("A6:A12")
Sheets("Sheet1").Unprotect

For Each c In myRng
    If c.Text <> Format(Now(), "dd mmmm yyyy") Then
        Sheets("Sheet1").Range("C6,E6,G6,I6").Locked = True
    End If
Next c
Sheets("Sheet1").Protect

End Sub
Post back with any problems - just in case I've headed down the wrong track.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-03-2008, 03:15 PM   #8 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

Thank you! I am having a problem with this code though. It gives me an error when I try to enter the first X in C6 (I have also tried to enter something in the other fields and it comes up with the same error and line under debug) and when i goto debug the line, "If Intersect(Target, Range("A6:A12")) Then" is highlighted yellow. I have the dates in A6:A12 formated the way you requested by the way... Any idea where the hang up could be? Thank you!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-03-2008, 03:41 PM   #9 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Hmmm....I think I know what I've done (or not done) - I'll get back to you - probably tomorrow.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-03-2008, 04:23 PM   #10 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

Awesome, thanks!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-04-2008, 12:52 PM   #11 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Been thinking about this - see if this suggestion has any possibilities.

You want some kind of electronic time card. At the moment, it looks like you are asking users to type the word 'clock' in a particular cell, and a time is then displayed using code. There is also an update process (some of which is causing some of the problems...).

How about using an input box? Perhaps a couple of buttons on a front sheet and the user has no access to any other sheets. Click one button to sign in - I'm guessing they will need to type their name - the time can be placed on any sheet and no need to use all these Change Events etc. You could do the same for signing out and have Excel calculate time worked or whatever. Hopefully you can see what I'm aiming at here - what do you think?
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-04-2008, 02:49 PM   #12 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

That does sound like a good idea. I would input a validation list of names and they just bring down the box, click there name and click the clock-in or clock out button which will then timestamp a seperate sheet and calculate the time.

The way i have it now is that they just put a X in cell under clock in and it time stamps the cell adjacent to it with the time, they click another cell to clock out for lunch and then one to clock in for lunch and a last cell to clock out for the day. Then using some basic calculations it adds the time up and decides if there is any overtime and inputs the data into a seperate payroll transmittal sheet used to upload into payroll system.

I like the idea of being able to click either clock in or clock out and transfering the data to a hidden sheet. What is the best way to do this? By the way if you would like I could send you a copy of what I have been working on if you would like to get an idea of what I am talking about. Thank you again.
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-04-2008, 03:27 PM   #13 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Sure, attach a copy (remember to remove any data you consider sensitive), although I have my own 'style', if that's the correct word, for doing things like this. I do try to keep it simple if possible.

The advantage of using an input box is that the users will only have access to one sheet - the rest can be hidden, and any menus that they might try to 'tweak' can also be hidden, or disabled.

To attach a file to a new post, simply
  1. Click the[Manage Attachments] button under Additional Options > Attach Files on the post composition page, and
  2. copy and paste the file into the "Upload File from your Computer" box:
  3. Click Upload.

You'll need to zip or compress the file. I'll have a look and see what I can come up with.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-04-2008, 05:46 PM   #14 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

There are 2 files in this zip. One is the original time card I was working on which has some basic calculations. The other is a version I was designing using your recomendation, however it has no code in it for the punch of the buttons. Thank you again!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-06-2008, 06:24 PM   #15 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

I have been working on this and I think the best way to do it is to have 4 buttons on the first page, clock in, out for lunch, in for lunch and clock out for day. The button when clicked should check the name listed in cell A3 and match it with a name in on the clock data sheet and then match the date from the main page with a date on clock data sheet and then unprotect the sheet to input the time stamp on the correct field and then protect the sheet. I recorded some macros but I can not get the lookup to work, to where it matches the name and date selected on sheet 1 (time clock) with the info on sheet 2 (clock data)...

Will you take a look and see if there is any help you can give me on this? Thank you for your help thus far by the way!
Attached Files
File Type: zip TimeCard with Button alpha copy 3.6.08.zip (59.9 KB, 18 views)
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-07-2008, 06:32 AM   #16 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Hi

Sorry - things have been a bit busy, but I have done some work on this (before looking at your versions). I should be able to devote time to this over the weekend.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-07-2008, 03:08 PM   #17 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Tried to open your files but couldn't - I'm using XL2002 - I suspect you may be using XL2007?

How many staff will this be used by? My first take requires only one button, and uses a dropdown with staff names and 2 option buttons - one for sign in and the other for sign out. I'll need to add in some columns for lunch breaks, but it works OK at the moment.
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-08-2008, 11:10 AM   #18 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

Yeah i am using 2007. Sorry about that. Well we have about 230 people who would be using it but it would be seperated by location and department which would break down to about 20 people per department. What you just said is almost exactly what my spreadsheet looked like, just without functioning buttons. I had them set to a macro which would goto the right sheet and enter the time but only for one user. I am also thinking of going another way with this... Once again we are just using an old manual time clock to punch in and out and this takes payroll FOREVER to punch each entry into our payroll system... I am thinking of implimenting a company intranet and using a online timeclock using asp... One of our sister companies is doing this and it seems to be working well for them, the only problem is the maintence it requires.
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-08-2008, 11:14 AM   #19 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 25,432
OS: Win XP Pro SP3 / Win 7 Pro

My System

Blog Entries: 10
Re: Time Stamp Multiple Cells in Excel

Hi

Do you want me to keep working on this just now, bearing in mind your comments about an online database?
__________________
Iain - Defender of the Haggis and all things Scottish.
I don't help by PM - post in the Forums.



PC Safety & Security::PC running a bit slow?::Donate::Photographers Corner
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 03-08-2008, 11:45 AM   #20 (permalink)
Registered User
 
Join Date: Feb 2008
Posts: 21
OS: XP


Re: Time Stamp Multiple Cells in Excel

No, lets hold off. i am going to be doing some more reasearch into the online version so I am going to just put this on hold for now. I will get back with you possibley in the future. Thank you for all the help and time you have put into this thus far. I am sure I will be back here asking you more questions later... Take care!
shawnb18 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 07:10 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85