Macro help- Push button that tracks what time it is pushed

kd19504

New Member
Joined
Oct 28, 2014
Messages
1
Hi all, I have a very basic background in macros but I am attempting to create a macro that when the button is pushed, a spreadsheet will track what time it was pushed at. Does anyone have suggestions? At this point I have just tried recording the macro by doing that, but on the spreadsheet I'm tracking it on, it won't move to the next cell to track the next time.

Any help is appreciated!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I take it you want a list of times for every time the Button is Clicked?


This records the button click times on column Z on sheet1 edit as required


Code:
Private Sub CommandButton1_Click()
Dim recordDepth As Long
recordDepth = Sheets("Sheet1").Cells(Rows.Count, "Z").End(xlUp).Row + 1
Cells(recordDepth, "Z").Value = Format(Now(), "HH:NN:SS")
'...... your code here
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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