1

I have an array of dates that I am transposing to a range. However they are not transposed as dates, they are transposed as strings.

Dim termdates As Variant
termdates = Array(DateSerial(2020,6,20), DateSerial(2021,6,20), DateSerial(2022,6,20))

Range("C1:C3").Formula = Application.Transpose(termdates)

How do I convert range("C1:C3")to dates? Alternatively is there a better way to copy the dates from termdates that does not require an additional conversion?

Thank you in advance

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
dsugasa
  • 663
  • 1
  • 9
  • 26
  • 1
    The code to transpose without losing dateness is at the bottom of the [answer](https://stackoverflow.com/a/53350351/11683) (you need to transpose manually). – GSerg Apr 03 '19 at 09:22
  • Thank you, forgive the rookie questions. So if I want to maintain the date format, I need to transpose manually. If I wanted to convert the range of string dates after the fact, what would be the syntax? I have tried using CDate, but I am not getting it to work. – dsugasa Apr 03 '19 at 09:38
  • 1
    https://superuser.com/q/299437/52365 – GSerg Apr 03 '19 at 09:53
  • https://stackoverflow.com/q/20375233/7204030 this did the trick for me. Thank you – dsugasa Apr 03 '19 at 10:00

0 Answers0