SetDateTimeFmtType Method

The SetDateTimeFmtType method sets both the date and time format types.

 

Syntax

object.SetDateTimeFmtType( DateType, TimeType )

 

Parameter

Type

Description

DateType

wksDateFmtType

required; sets date format type

TimeType

wksTimeFmtType

required; sets time format type

 

Remarks

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.

 

Example

    '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