Number Date And Time Format Codes. Available Types class datetimedate. The code snippet below uses the d m and Ycharacters to return the date in the format dd-mm-yyyy and uses the r character to return the time 12-hour format using the time zone t character.
Date-time and number formats let you control how your data appears in a sheet. E and E- followed by atleast one 0 character in format code displays the number in scientific notation with the character E mentioned between the number and the exponent. Displays the month as text January February March and so on d.
On the Home tab click Number Format and then click More Number Formats.
On the Home tab click Number Format and then click More Number Formats. Sub Date_Format_Example1 RangeA1NumberFormat dd-mm-yyy This will chnage the date to 23-10-2019 End Sub. Likewise for the Time category. You can use the ampersand text operator to join or concatenate two values.