Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code help.
All,
Can anyone provide some code that will allow me to enter the current time into the active cell? I know the shortcut Ctrl+Shift+Colon will enter the time in the cell, but I would like to create a time button in this workbook, and link this macro to it so the user will just have to select the cell and hit the button to enter the current time. Can anyone help? Thanks in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code help.
ActiveCell = Format(Now(), "h:mm AM/PM")
Richard Choate "Ken" wrote in message ... All, Can anyone provide some code that will allow me to enter the current time into the active cell? I know the shortcut Ctrl+Shift+Colon will enter the time in the cell, but I would like to create a time button in this workbook, and link this macro to it so the user will just have to select the cell and hit the button to enter the current time. Can anyone help? Thanks in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code help.
Ken
try ActiveCell.Value = WorksheetFunction.Text(Now(), "h:mm AM/PM") You will have to nominate the cell to put it in - this is just to give you an idea for syntax. Tony -----Original Message----- All, Can anyone provide some code that will allow me to enter the current time into the active cell? I know the shortcut Ctrl+Shift+Colon will enter the time in the cell, but I would like to create a time button in this workbook, and link this macro to it so the user will just have to select the cell and hit the button to enter the current time. Can anyone help? Thanks in advance! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Code to conditional format all black after date specified in code? | Excel Discussion (Misc queries) | |||
Drop Down/List w/Code and Definition, only code entered when selec | Excel Worksheet Functions | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
copying vba code to a standard code module | Excel Discussion (Misc queries) |