SetDateTimeFmtType

The SetDateTimeFmtType method controls date/time formatting in the worksheet.

Syntax

object.SetDateTimeFmtType( DateType, TimeType )

Parameter

Type

Description

DateType

wksDateFmtType

required; date format

TimeType

wksTimeFmtType

required; time format

Example

This example shows how to set the date and time format for a cell.

'Sets the date format to m/d/yy such as: 9/7/98

WksCellFormat.SetDateTimeFmtType (wksDateFmt_M_D_YY,wksTimeFmt_NONE)

 

'Sets the time format to h:mm such as: 14:45

WksRange.Format.SetDateTimeFmtType(wksDateFmt_NONE, wksTimeFmt_H_MM)

Used by: WksCellFormat object