Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
rediming dynamic 2 dimensional array of user defined type
I defined a dynamic array as a programmer defined type that contains a
dynamic array of type Date as below: Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material when I go to redim them as such: ' no problem here ReDim matType(1 To MaxMaterials) ' error invalid qualifier "matType." if I leave it out, does not create an array ReDim matType.MatDate(1 To MaxArraySize) any ideas how to redim the MatDate? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
rediming dynamic 2 dimensional array of user defined type
Maybe you want something like:
Option Explicit Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material Sub testme() Dim MaxMaterials As Long Dim MaxArraySize As Long Dim ictr As Long MaxMaterials = 3 MaxArraySize = 4 ' no problem here ReDim matType(1 To MaxMaterials) For ictr = 1 To MaxMaterials ReDim matType(ictr).MatDate(1 To MaxArraySize) Next ictr End Sub if each mattype has the same number of .matdates. Arnold Klapheck wrote: I defined a dynamic array as a programmer defined type that contains a dynamic array of type Date as below: Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material when I go to redim them as such: ' no problem here ReDim matType(1 To MaxMaterials) ' error invalid qualifier "matType." if I leave it out, does not create an array ReDim matType.MatDate(1 To MaxArraySize) any ideas how to redim the MatDate? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
rediming dynamic 2 dimensional array of user defined type
Public Type Material
MatNum As Integer MatDate() As Date End Type Public matType() As Material Const MaxMaterials As Long = 12 Sub ABCEFG() ReDim matType(1 To MaxMaterials) For i = 1 To MaxMaterials ReDim matType(i).MatDate(1 To 10) Next End Sub -- regards, Tom Ogilvy "Arnold Klapheck" wrote: I defined a dynamic array as a programmer defined type that contains a dynamic array of type Date as below: Public Type Material MatNum As Integer MatDate() As Date End Type Public matType() As Material when I go to redim them as such: ' no problem here ReDim matType(1 To MaxMaterials) ' error invalid qualifier "matType." if I leave it out, does not create an array ReDim matType.MatDate(1 To MaxArraySize) any ideas how to redim the MatDate? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Type Mismatch: array or user defined type expected | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Passing User Defined Type Array to Listbox | Excel Programming | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
Passing an Array of User-Defined Type to an Argument of a Function | Excel Programming |