PDA

View Full Version : Solved: populate column with array values



CatDaddy
06-07-2011, 02:44 PM
to get the row header i use:


Range("B1:H1").Value = colHeader


colHeader being an array of 7 strings, and when i try the same for the row headers:


Range("A2:A31").Value = rowHeader


it copies rowHeader(1) 31 times instead of the 31 different strings in the rowHeader array...

CatDaddy
06-07-2011, 03:03 PM
when i change the range for the rowHeader to "A2:Z2" the array populates correctly...is there a column limitation i am unaware of?

mikerickson
06-07-2011, 07:33 PM
Excel sees a 1 dimesional array as a row-wise array.
To put your row headers:Range("A2:A31").Value = Application.Transpose(rowHeader)

CatDaddy
06-08-2011, 10:06 AM
THANK YOU! :beerchug: :beerchug: