0
I am trying to create a date in VBA. I want it to display as 13.04.2018 for today's date.
However, I can currently only get it to display as 13.4.2018
How do i include a preceding zero on days and months with a single digit ?
I have currently got to:
stDateDay = Day(Date)
stDateMonth = Month(Date)
stDateYear = Year(Date)
stDateFull = stDateDay & "." & stDateMonth & "." & stDateYear
2
strDateFull = format (Date, "dd.mm.yyyy")
? – Berend – 2018-04-13T11:06:23.0631Searching for "[microsoft-excel] date format" brings up 1148 posts. The answer to your question is likely among those. – Tom Brunberg – 2018-04-13T11:13:25.963
@TomBrunberg - that's a few less than a Google search for "vba date format" which gives 1.8 million options, the 2nd of which is MS's own docs... ;) – FreeMan – 2018-04-13T11:24:44.130
Yeah @Free there's plenty of too much :) – Tom Brunberg – 2018-04-13T11:38:32.843
@Berend Thanks, post as answer and i can accept as correct – PeterH – 2018-04-13T11:53:38.513