hi guys
have the following code that works until i try to use the new array in a different routine.
when i do a MsgBox Join(newArr, ", ") in new sub the it returns an empty message box yet works fine in this sub
grateful on any solutions to this prob
thanks
MC
Dim result As String
Dim resultsFinal() As String
ReDim resultsFinal(0)
Dim i As Integer
Dim newArr As Variant
i = 0
result = 0
Dim wsf As Worksheet
For Each wsf In Sheets
If wsf.Name Like myArr & "*" Then
result = result + 1
ReDim Preserve resultsFinal(result)
resultsFinal(i) = wsf.Name
i = i + 1
End If
Next wsf
newArr = resultsFinal
have the following code that works until i try to use the new array in a different routine.
when i do a MsgBox Join(newArr, ", ") in new sub the it returns an empty message box yet works fine in this sub
grateful on any solutions to this prob
thanks
MC
Dim result As String
Dim resultsFinal() As String
ReDim resultsFinal(0)
Dim i As Integer
Dim newArr As Variant
i = 0
result = 0
Dim wsf As Worksheet
For Each wsf In Sheets
If wsf.Name Like myArr & "*" Then
result = result + 1
ReDim Preserve resultsFinal(result)
resultsFinal(i) = wsf.Name
i = i + 1
End If
Next wsf
newArr = resultsFinal