ActiveX
To format a time 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 6 (Time).
- Specify whether the cell displays time in the 12- or 24-hour time format by setting the TypeTime24Hour property.
- If you want the cell to display seconds in the time value, set the TypeTimeSeconds property to True.
- Specify the character used to separate hours, minutes, and seconds by setting the TypeTimeSeparator property.
- If you selected a block of cells, set the BlockMode property back to False.