Good day everyone!
I'm a little new to this whole VBA thing but I do have a couple years of coding background now, so I'm not a complete newb!
What I'm trying to do is:
User is on a userform and clicks add button
add button brings user to another userform where they fill out information
once the user submits their input the content will be saved to an array that was initialized on the first userform.
My problem is it seems VBA can't recognize the array I've declared.
On my first userform I've declared my array in the general Declarations like this:
Public UserCompletedStudiesArray As Variant
Then, I initialized the userform and ReDim the array like this:
ReDim UserCompletedStudiesArray(1 To 20, 7) As String
On my second userform I do this:
Dim i As Integer
Dim arr As Variant
arr = TrainingForm.UserCompletedStudiesArray
For i = LBound(arr) To UBound(arr)
If
code that populates the array...
End If
Exit For
Next i
However the second userform doesn't recognize the array that was created on the first userform.
If there's anyone who could give me a hand with this I would greatly appreciate that!
I'm a little new to this whole VBA thing but I do have a couple years of coding background now, so I'm not a complete newb!
What I'm trying to do is:
User is on a userform and clicks add button
add button brings user to another userform where they fill out information
once the user submits their input the content will be saved to an array that was initialized on the first userform.
My problem is it seems VBA can't recognize the array I've declared.
On my first userform I've declared my array in the general Declarations like this:
Public UserCompletedStudiesArray As Variant
Then, I initialized the userform and ReDim the array like this:
ReDim UserCompletedStudiesArray(1 To 20, 7) As String
On my second userform I do this:
Dim i As Integer
Dim arr As Variant
arr = TrainingForm.UserCompletedStudiesArray
For i = LBound(arr) To UBound(arr)
If
code that populates the array...
End If
Exit For
Next i
However the second userform doesn't recognize the array that was created on the first userform.
If there's anyone who could give me a hand with this I would greatly appreciate that!