Click a Button to Time Stamp A Specific Cell.

Gryrok

New Member
Joined
Feb 16, 2016
Messages
6
Greetings All!

I'm with a team who uses excel to keep track of events, start & end times etc. We use excel now but everyone has to type in the times manually. I'd like to make a sheet that would have buttons next to the cells where the time needs to go, and if they click the button it would add the time to the adjacent cell.

Right now I've got this code (From another forum on this awesome website) in a macro:


sub EnterTime()
activecell.value=time
End sub

and I've attached it to a button so the current time is entered into whatever cell is selected when the button is pressed. Can anyone help me adjust this so clicking the button enters the time into the cell right next to the button?

Thanks for your assistance!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Greetings All!

I'm with a team who uses excel to keep track of events, start & end times etc. We use excel now but everyone has to type in the times manually. I'd like to make a sheet that would have buttons next to the cells where the time needs to go, and if they click the button it would add the time to the adjacent cell.

Right now I've got this code (From another forum on this awesome website) in a macro:


sub EnterTime()
activecell.value=time
End sub

and I've attached it to a button so the current time is entered into whatever cell is selected when the button is pressed. Can anyone help me adjust this so clicking the button enters the time into the cell right next to the button?

Thanks for your assistance!
Hi Gryrok,

Without knowing where the button is I will have to guess, so assuming that for example the button is in cell A1 the code would be

Code:
Sub EnterTime()
Range("B1").Value = Time
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,270
Members
449,149
Latest member
mwdbActuary

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