I have some issue with my VBA code. I got Date variable that stored as dd/mm/yyyy
but when I write the date to a specific cell the format change to mm/dd/yyyy
, I have been trying many options but none of them worked for me, I also check that the variable know what is the current day, month and year.
The code:
Sheets("report_orders").Select
Range("A1").Value = customerName
Range("A2").Value = "???e? " & orderID
Range("A3").Value = "???e? ì÷?? " & orderPo
'Range("B2").Value = orderDate
Range("B2").Value = Day(orderDate) & "/" & Month(orderDate) & "/" & Year(orderDate)
Debug.Print "year " & Year(orderDate)
Debug.Print "month " & Month(orderDate)
Debug.Print "day " & Day(orderDate)
but the result is :
question from:
https://stackoverflow.com/questions/65881901/write-date-to-cell-and-change-date-format 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…