View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jonigr jonigr is offline
external usenet poster
 
Posts: 13
Default Transferring a Date array to a range

I am having trouble transferring a €śDate array€ť to a range.

In my XL sheet cells A1-A3 are pre-formatted as mm/dd/yyyy dates.

MyDateArray is a two dimensional (3, 1) array containing dates, say all
three are 05/11/2007.

When I try

Range("A1").Resize(1, 1) = MyDateArray(1, 1)

this works perfect and puts

05/11/2007

in A1, but

Range("A1").Resize(3, 1) = MyDateArray

gives me three times

01/00/1900
01/00/1900
01/00/1900

in A1-A3.

This is actually a much longer array and I prefer not to loop through all
the elements. Is there a way to transfer it to the sheet at once without
disturbing the dates? Thanks very much!