View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter81[_8_] Peter81[_8_] is offline
external usenet poster
 
Posts: 1
Default Help with Date Macro/Function


This enters the date & time into cell A1 of Sheet1,
Hope this is what your after.

Sub DateMacro()

Dim myNow As String

myNow = Format(Now(), "YYMMDDhhmmss")

With Sheets("Sheet1").Range("A1")
.NumberFormat = "@"
.Value = myNow
End With

End Sub

Pet

--
Peter8
-----------------------------------------------------------------------
Peter81's Profile: http://www.excelforum.com/member.php...fo&userid=2535
View this thread: http://www.excelforum.com/showthread.php?threadid=53260