SetDateTimeFmtType Method

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 Month D,YYYY such as: January 4, 2007

WksRange.Format.SetDateTimeFmtType (wksDateFmt_MONTH_D_YYYY,wksTimeFmt_NONE)

 

'Sets the time format to H:MM:SS such as: 12:10:15 WksRange.Format.SetDateTimeFmtType(wksDateFmt_NONE, wksTimeFmt_H_MM_SS)

 

Used by: WksCellFormat object