Thread
:
How to code ReDim Preserve when "ReDim strArr(1 To 100, 1 To 3)"
View Single Post
#
7
Posted to microsoft.public.excel.programming
Dana DeLouis
external usenet poster
Posts: 947
How to code ReDim Preserve when "ReDim strArr(1 To 100, 1 To3)"
wrote:
Dim strArr() As String
Dim iCtr as Long
ReDim strArr(1 To 100, 1 To 3)
......
......
Getting an error if I code:
ReDim Preserve strArr(1 To iCtr).elements(1 to 3)
Any thoughts appreciated!
EagleOne
Any ideas here you can use?
Sub Demo()
Dim m()
ReDim m(1 To 1, 1 To 1)
m(1, 1) = "Test Data"
With WorksheetFunction
ReDim Preserve m(1 To 1, 1 To 3)
m = .Transpose(m)
ReDim Preserve m(1 To 3, 1 To 100)
m = .Transpose(m)
End With
End Sub
'It's resized to (100 by 3)
= = =
HTH :)
Dana DeLouis
Reply With Quote
Dana DeLouis
View Public Profile
Find all posts by Dana DeLouis