Load an Array to be used in ANY sub
Public aMyList() As Variant
Public Sub Load_aMyList_PublicArray()
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim sMyList As String, aSplitStr As Variant, iUboundMyList As Long
sMyList = "^Apples^Oranges^Bananas^Grapes^Watermelons"
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
aSplitStr = Split(sMyList, "^")
iUboundMyList = UBound(aSplitStr)
Erase aMyList
ReDim aMyList(1 To iUboundMyList, 1)
For iLoop = LBound(aSplitStr) To UBound(aSplitStr)
If iLoop <= iUboundMyList And iLoop > 0 Then
aMyList(iLoop, 1) = aSplitStr(iLoop)
End If
Next iLoop
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Erase aSplitStr
End Sub
Public Sub Load_aMyList_PublicArray()
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim sMyList As String, aSplitStr As Variant, iUboundMyList As Long
sMyList = "^Apples^Oranges^Bananas^Grapes^Watermelons"
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
aSplitStr = Split(sMyList, "^")
iUboundMyList = UBound(aSplitStr)
Erase aMyList
ReDim aMyList(1 To iUboundMyList, 1)
For iLoop = LBound(aSplitStr) To UBound(aSplitStr)
If iLoop <= iUboundMyList And iLoop > 0 Then
aMyList(iLoop, 1) = aSplitStr(iLoop)
End If
Next iLoop
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Erase aSplitStr
End Sub