The SetDateTimeFmtType method sets both the date and time format types.
object.SetDateTimeFmtType( DateType, TimeType )
Parameter |
Type |
Description |
DateType |
required; sets date format type |
|
TimeType |
required; sets time format type |
Enter either the Description or Value from wksDateFmtType for the DateType value to apply date formatting.
Enter either the Description or Value from wksTimeFmtType for the TimeType value to apply time formatting.
'SetDateTimeFmtType
'Set the date time format of the entire used worksheet to be presented as 1 January 2015 (only affects numerical values)
'DateType uses the format description, TimeType uses the format value
Wks.UsedRange.Format.SetDateTimeFmtType(DateType:=wksDateFmt_D_MONTH_YYYY, TimeType:=0)
Used by: WksCellFormat object