Hi there.
I working with a dataset extracted from a ERP-system. The ERP-system is delivery a date in the danish format (dd-mm-yyyy), and I are storing the date in a string variable "DateAsString".
But when I am doing like this:
Worksheets("Sheet1").Cells(1,1).Value=DateAsString
VBA translate it into US format.
And it doesn't matter if I change the format of the cell before I assign the value to the cell:
Worksheets("Sheet1").Cells(1,1).NumberFormat = "d/m/yyyy".
I think this is related to that VBA treats all dates as US-dates, but I can't understand why I can't control the format of the specific cell.
Any good advice...?
Kind regards
Hans
I working with a dataset extracted from a ERP-system. The ERP-system is delivery a date in the danish format (dd-mm-yyyy), and I are storing the date in a string variable "DateAsString".
But when I am doing like this:
Worksheets("Sheet1").Cells(1,1).Value=DateAsString
VBA translate it into US format.
And it doesn't matter if I change the format of the cell before I assign the value to the cell:
Worksheets("Sheet1").Cells(1,1).NumberFormat = "d/m/yyyy".
I think this is related to that VBA treats all dates as US-dates, but I can't understand why I can't control the format of the specific cell.
Any good advice...?
Kind regards
Hans