Dear fellow OzGridians
i've come across something that i'd like to do with regards to populating an array/variant not using a global variable.
i currenty have this for testing purposes which works, but perhaps not the best solution?
Code
Private vntArrayCodes() As Variant
Sub populateVntArrayCodes(ByVal intArrayCount As Integer, _
ByVal strCode As String)
ReDim Preserve vntArrayCodes(intArrayCount)
vntArrayCodes(intArrayCount) = strCode
End Sub
Sub x()
For i = 0 To 9
populateVntArrayCodes i, "A" & i + 1
Next i
' Msgbox Data Back for test purpose.
For i2 = LBound(vntArrayCodes) To UBound(vntArrayCodes)
MsgBox vntArrayCodes(i2)
Next i2
End Sub
Display More
Is there another way to do this without using a OO Classes?
Many thanks
Craig