Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
regional settings.
Range("A1").Value = "vbShortDate"
Range("B1").Value = FormatDateTime(Now, vbShortDate)
Range("A2").Value = "vbShortTime"
Range("B2").Value = FormatDateTime(Now, vbShortTime)
settings.
Range("A4").Value = "vbLongDate"
Range("B4").Value = FormatDateTime(Now, vbLongDate)
Range("A5").Value = "vbLongTime"
Range("B5").Value = FormatDateTime(Now, vbLongTime)
If there Is a time part, display it As a Long time. If present, both parts are displayed.
Range("A7").Value = "vbGeneralDate"
Range("B7").Value = FormatDateTime(Now, vbGeneralDate)
Columns("A:B").EntireColumn.AutoFit
Range("A1").Select
End Sub
|