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

后端 未结 2 880
忘了有多久
忘了有多久 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:15

    Your issue is with attempting to change your month by adding 1. 1 in date serials in Excel is equal to 1 day. Try changing your month by using the following:

    NewDate = Format(DateAdd("m",1,StartDate),"dd/mm/yyyy")
    

提交回复
热议问题