“dd/mm/yyyy” date format in excel through vba

后端 未结 2 886
忘了有多久
忘了有多久 2021-01-12 07:34

I am trying to write a date in \"dd/mm/yyyy\" format in excel sheet thru excel-vba. I achieved it using Cells(1, 1).Value = Format(StartDate, \"dd/mm/yyyy\"). a

2条回答
  •  长情又很酷
    2021-01-12 08:19

    I got it

    Cells(1, 1).Value = StartDate
    Cells(1, 1).NumberFormat = "dd/mm/yyyy"

    Basically, I need to set the cell format, instead of setting the date.

提交回复
热议问题