Mackeral
Board Regular
- Joined
- Mar 7, 2015
- Messages
- 249
- Office Version
- 365
- Platform
- Windows
Variant_Array(1) "Line 1"
Variant_Array(2) = "LIne 2"
Call Var_Add(Variant_Array,,"Line 3", "Line 4") ' "Variant_Array" has good data in it before the call.
.
My problem is that "UBound(Variant_Array)" always returns a 0, or another way of stating the problem is that "Variant_Array" doesn't contain anything after the call.
What am I missing? & thanks for your help.
Mac
Variant_Array(2) = "LIne 2"
Call Var_Add(Variant_Array,,"Line 3", "Line 4") ' "Variant_Array" has good data in it before the call.
.
VBA Code:
Function Var_Add(Variant_Array() As Variant, ParamArray LINES()) As Variant
Knt = UBound(Variant_Array)
For Each Line In LINES
Knt = Knt + 1
ReDim Preserve Variant_Array(Knt)
Variant_Array(Knt) = Line
Next Line
Var_Add = Variant_Array
End Function ' Var_Add
My problem is that "UBound(Variant_Array)" always returns a 0, or another way of stating the problem is that "Variant_Array" doesn't contain anything after the call.
What am I missing? & thanks for your help.
Mac