May 8, 2002 #1 daltek Programmer Nov 13, 2001 3 US Is there a way to insert today's date using a macro, but have the date not update when the day changes? Like a date stamp that doesn't update.
Is there a way to insert today's date using a macro, but have the date not update when the day changes? Like a date stamp that doesn't update.
May 8, 2002 #2 AngO Instructor Jan 31, 2002 155 US daltek, You don't need a macro, unless you want one. The keyboard shortcut to insert the current date as text is [ctrl]; (semi-colon). If you want a macro - I record typing in the formula =today() copy it paste special, value stop macro results in: ActiveCell.FormulaR1C1 = "=TODAY()" Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False There maybe "cleaner" code to do the same thing. Hope this helps. AngO Upvote 0 Downvote
daltek, You don't need a macro, unless you want one. The keyboard shortcut to insert the current date as text is [ctrl]; (semi-colon). If you want a macro - I record typing in the formula =today() copy it paste special, value stop macro results in: ActiveCell.FormulaR1C1 = "=TODAY()" Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False There maybe "cleaner" code to do the same thing. Hope this helps. AngO
May 8, 2002 #3 Yogi39 Technical User Jun 20, 2001 273 CA You might want to trigger the macro when the cell you want the date in is selected.....Hope this helps you Upvote 0 Downvote
You might want to trigger the macro when the cell you want the date in is selected.....Hope this helps you
May 9, 2002 Thread starter #4 daltek Programmer Nov 13, 2001 3 US Thanks. Worked great. Paste Special was the key. Upvote 0 Downvote