ActiveX
To format a date cell
At run time,
- If your control contains more than one sheet, specify the sheet with which you want to work by setting the Sheet property.
- Set the Col, Col2, Row, and Row2 properties as appropriate.
- If you are selecting a block of cells, set the BlockMode property to True.
- Set the CellType property to 0 (Date).
- Specify the date format by setting the TypeDateFormat property.
- Display the year in century format (four-digits), by setting the TypeDateCentury property to True.
- Specify the character that separates the day, month, and year by setting the TypeDateSeparator property.
- If you want to display a spin button, set the TypeSpin property to True.
- If you selected a block of cells, set the BlockMode property back to False.