Macro help?

K

Ken

Hi all,

I am looking for some code that will allow me to enter the
current time into a cell by using a shortcut key...(Ctrl+T
for example). Or possibly by using a button. I've never
used a button before but I'm sure I can figure it out. Any
insight? Thanks in advance.
 
J

JS

hi - the following code will put the time in the active cell

Sub TimeMacro()
ActiveCell.Value = Now
End Sub

Type the macro into a module and then in the spreadsheet display the Forms
Toolbar - create a Command Button on the sheet and assign this macro to it
 
G

Gord Dibben

Ken

Do you need a macro?

CRTL + SHIFT + ;(semi-colon) will enter the current time.

CRTL + ; will enter current date.

Gord Dibben Excel MVP - XL97 SR2 & XL2002
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top