brianfosterblack
Active Member
- Joined
- Nov 1, 2011
- Messages
- 251
I am using this line of code in my macro but it gives the wrong date format
I am getting the date as mm/dd/yyyy and then hours and seconds
all other dates in the workbook are fine but it gets confusing when most dates are 10/9/2021 and this date is 9/10/2021 because the month is first.
I cannot seem to change this format, even in the cell and it is only when I run code for a date without the time that I get the right format.
I have checked all my regional settings and they are right.
VBA Code:
Range("Reports!H3").Value = Format(Now, "dd/mm/yyyy HH:mm:ss")
all other dates in the workbook are fine but it gets confusing when most dates are 10/9/2021 and this date is 9/10/2021 because the month is first.
I cannot seem to change this format, even in the cell and it is only when I run code for a date without the time that I get the right format.
I have checked all my regional settings and they are right.