Why does transposing array with dates in format dd/mm/yy change some dates to mm/dd/yy format?

后端 未结 3 1996
隐瞒了意图╮
隐瞒了意图╮ 2021-01-07 09:39

Behavior:

When I transpose a 1 dimensional array, containing dates, in order to print them to a sheet in it\'s entirety, some dates are changed from the dd/m

3条回答
  •  天命终不由人
    2021-01-07 10:29

    Transposing array with Application.Transpose() transforms the "Date" data type into "String". Not able to explain why. So my suggestion is to transform the Column with "Date" data type into "Long" before you do the Application.Transpose() (simply using CLng). After that you can either transform it back to "Date" or just set the number format as "Date" for the cells, where you would like to paste the array.

提交回复
热议问题