I would like to get current date and time with following format ""13-Feb-2005 17:19"". Is there any VBA code to get that?
Best regards,
I would like to get current date and time with following format ""13-Feb-2005 17:19"". Is there any VBA code to get that?
Best regards,
By example, for A1 of current sheet, try:
[vba]Option Explicit
Sub exa()
With Range("A1")
.NumberFormat = "d-mmm-yyyy Hh:Mm"
'// to return now
'.Value = Now()
'//to return ex date/time
.Value = DateSerial(2005, 2, 13) + TimeSerial(17, 19, 0)
.EntireColumn.AutoFit
End With
End Sub[/vba]
Hope that helps,
Mark