ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Adding a control button to insert a date in the active cell. (https://www.excelbanter.com/excel-discussion-misc-queries/13189-adding-control-button-insert-date-active-cell.html)

Mike

Adding a control button to insert a date in the active cell.
 
Hello,
I'm trying to make a control button that will populate a static date (Ctrl
+) in the active cell that the person has chosen.
Any input is greatly appreciated.

Gord Dibben

Mike

Sub NOWDATE()
ActiveCell.Value = Format(Date, "dd-mmm-yy")
End Sub


Gord Dibben Excel MVP

On Tue, 15 Feb 2005 09:41:08 -0800, "Mike"
wrote:

Hello,
I'm trying to make a control button that will populate a static date (Ctrl
+) in the active cell that the person has chosen.
Any input is greatly appreciated.



Richard

Try This.

Sub Time_Stamp()
'
' Time_Stamp Macro
'

'
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.FormulaR1C1 = "=NOW()"
ActiveCell.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "h:mm"
ActiveCell.Columns
("A:A").EntireColumn.EntireColumn.AutoFit
End Sub
-----Original Message-----
Hello,
I'm trying to make a control button that will populate a

static date (Ctrl
+) in the active cell that the person has chosen.
Any input is greatly appreciated.
.



All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com