Mackeral
Board Regular
- Joined
- Mar 7, 2015
- Messages
- 249
- Office Version
- 365
- Platform
- Windows
VBA Code:
Function Var_Add(Variant_Array() As Variant, ParamArray LINES() As Variant)
Knt = UBound(Variant_Array) '<-- This is always set to 0
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
Input Data
Variant_Array(1) = "Line 1"
Variant_Array(2) = "Line 2"
Called: Call Var_Add(Varient_Array, "Line 3", "Line4")
The problem is that "Variant_Array" does not contain anything.