) |
In excel if i select cell properties and change format to date it changes it correctly to the date format I am looking for (2020-06-12)
The problem is in vba. I need to extract the month "mm" and use in a later formula. Here is a snippet of my code.
IESODATMonthRaw = ws3.Range("b2").NumberFormat = "date"
Or
IESODATMonthRaw = ws3.Range("b2").NumberFormat = "yyy-mm-dd"
Both these statements return the wrong data. Gives me the following
12:00:00:AM
I have another statement later that extracts the month from it and it returns a value of 12. (which it looks like it is getting from the original data)
IESODATMonth = Month(IESODATMonthRaw)