E
ExcelMonkey
I have an public array. I am dimensioning it in a sub, then trying to load
the first value into it. Example 1 works. However Example 2 does not work
when I try to load the array in another sub. I am getting a Run-Time Error
13 Type Mismatch. Why is this?
Example 1
Public RangeInventoryArray As Variant
----------------------------------------------
Sub1()
ReDim RangeInventoryArray(0 To 0)
RangeInventoryArray(0) = 2
End Sub
Example 2
Public RangeInventoryArray As Variant
------------------------------------------------
Sub1()
ReDim RangeInventoryArray(0 To 0)
Call Sub2
End Sub
Sub2()
RangeInventoryArray(0) = 2
End Sub
Thanks
EM
the first value into it. Example 1 works. However Example 2 does not work
when I try to load the array in another sub. I am getting a Run-Time Error
13 Type Mismatch. Why is this?
Example 1
Public RangeInventoryArray As Variant
----------------------------------------------
Sub1()
ReDim RangeInventoryArray(0 To 0)
RangeInventoryArray(0) = 2
End Sub
Example 2
Public RangeInventoryArray As Variant
------------------------------------------------
Sub1()
ReDim RangeInventoryArray(0 To 0)
Call Sub2
End Sub
Sub2()
RangeInventoryArray(0) = 2
End Sub
Thanks
EM