Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I want to transpose a range in an excel data and store the values in an array. The code I have is: Sub TransposeThat() Set DB = Selection nrows = DB.Rows.Count ncols = DB.Columns.Count For i = 1 To nrows For j = 1 To ncols ReDim Preserve TArray(1 To j, 1 To i) TArray(j, i) = DB(i, j) Next j Next i End Sub DB is the range on the worksheet. I get the message: subscript out of range applying to the redim preserve statement. Why am I getting that error? Thanks, bill |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prevent cell/array references from changing when altering/moving thecell/array | Excel Discussion (Misc queries) | |||
meaning of : IF(Switch; Average(array A, array B); array A) | Excel Worksheet Functions | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |