Creating a simple time clock macro

REDNAV

New Member
Joined
Mar 8, 2012
Messages
5
I will start off by explaining the situation. Here at work we have a peice of paper in the front of the office that people sign in and out. Not to actually track time for payroll but in case someone cant be found in the office you can check the sheet to see if they have left or not. I want to create something similar in excel where there is a button by there name and when they click it the current time is placed in the IN cell then when they leave they click the button again and the current time is placed in the OUT cell. I am terrible with macros and wondered if there is something already out there?
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Sorry for being incompetent, but this seems over my head. I can't get it to work. Does anyone have an example in an excel sheet to use as a reference? I would be greatly appreciative. If you do and wouldnt mind sending it to me my email address is jodale12@gmail.com. Thanks
 
Upvote 0
Nothing very complicated if you follow the steps.

Did you put the code within the sheetmodule as I wrote?

TO INSTALL IN SHEET CODE WINDOW:
1. right click the "Name Tab" of sheet you want code to work in
2. Select "View Code" in drop down menu
3. VBE window will open ... paste code in and exit VBE


Now doubleclick in column A and see what happens.

That's all :)
 
Upvote 0
Erik,

Works perfect! Exactly what I was looking for, except I like your double-click method better. Thanks!
 
Upvote 0
You're welcome!
You could use "rightclick" or just "select" also: discover for yourself what's in that sheetcode module :)
 
Upvote 0
Sorry to bring up an old thread. This was incredibly helpful.

Is there a way to add a date stamp to that? I tried simply putting the date format behind time, but no luck. Would like to have it read with the date and time underneath (AM or PM) in one cell. Anyone?

Thanks.
 
Upvote 0
Sorry to bring up an old thread. This was incredibly helpful.

Is there a way to add a date stamp to that? I tried simply putting the date format behind time, but no luck. Would like to have it read with the date and time underneath (AM or PM) in one cell. Anyone?

Thanks.
Hi
Welcome to MrExcel!

It is risky to respond to old threads. Probably only a few people will see your post.

You can take a look in the VBA help files for "Format". It would even be inspiring to check the Excel function "Format" itself. They are quite the same.
Use "d" or "dd" or "ddd" for day and add some "mmm"s or "yyy"s etcetera...

Then look also at "Time", and other functions like "Now", which are also quite the same between VBA and Excel.

Just edit the bold parts.
Cells(.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = Format(Time, "hh:mm")
Cells(.Row, Columns.Count).End(xlToLeft).Offset(0, 1) = Format(Now, "yy-mm-dd hh:mm")

kind regards,
Erik
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

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