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
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")
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.