I have a macro that uses the following bits of code:
strReportDate evaluates to 14 December 2023 when I hover over it in the VBE
I then use strReportDate to enter into column N
But this results in 14-Dec-23 in the cell. Excel has automatically formatted it to d-mmm-yy. This is not what I need - I need the text of strReportDate (14 December 2023)
What am I doing wrong?
VBA Code:
Dim ReportDate As Date, strReportDate As String
ReportDate = Date
strReportDate = Format(Date, "dd mmmm yyyy")
strReportDate evaluates to 14 December 2023 when I hover over it in the VBE
I then use strReportDate to enter into column N
VBA Code:
Xero.Sheets("Xero Sales Invoice").Range("N" & XeroRow + 1) = strReportDate
But this results in 14-Dec-23 in the cell. Excel has automatically formatted it to d-mmm-yy. This is not what I need - I need the text of strReportDate (14 December 2023)
What am I doing wrong?