Time Stamp with Screen Updating

sturnusek

Board Regular
Joined
Sep 20, 2018
Messages
51
Hi there,

I'm wondering if there is someone nice to type up a macro for me. So, generally I need a macro that once a button is clicked, it will create a Time Stamp in the 'U26' cell automatically. Once a button is clicked again, it will then place a Time Stamp in 'U27' and so on...

Any ideas?

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Code:
Sub CommandButton1_Click()

LRow = Cells(Rows.Count, "U").End(xlUp).Row

If LRow < 26 Then LRow = 26

Cells(LRow, "U").Value = format(now(), "hh:mm:ss")

End Sub
 
Last edited:
Upvote 0
Hi,

Thank you for this. I just used the code and it does place a Timestamp in U26, but once clicked again it doesn't 'move on' to U27, but refreshes itself.

Thanks
 
Upvote 0
My bad


Code:
[COLOR=#333333]Sub CommandButton1_Click()[/COLOR]
LRow = Cells(Rows.Count, "U").End(xlUp).Row +1

If LRow < 26 Then LRow = 26

Cells(LRow, "U").Value = format(now(), "hh:mm:ss")
 [COLOR=#333333]End Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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