J
JMay
I have in Module1
Global MyGuys()
Public Type Person
strFName As String
strLName As String
strAddress As String
strCity As String
strState As String
strZip As String
End Type
Public Sub LoadGuys()
Dim MyGuys(3) As Person
For i = 0 To 3
MyGuys(i).strFName = Cells(i + 5, 1)
MyGuys(i).strLName = Cells(i + 5, 2)
MyGuys(i).strAddress = Cells(i + 5, 3)
MyGuys(i).strCity = Cells(i + 5, 4)
MyGuys(i).strState = Cells(i + 5, 5)
MyGuys(i).strZip = Cells(i + 5, 6)
Next i
End Sub
=======================
After I run Loadguys Macro (which loads variables from my ws
in the immediate window I enter:
? MyGuys(2).strAddress
But get r/t 9 - Subscript out of range..
Can someone tell me why? What am I omitting not
to be able to bring up mytext
TIA,
JIM
Global MyGuys()
Public Type Person
strFName As String
strLName As String
strAddress As String
strCity As String
strState As String
strZip As String
End Type
Public Sub LoadGuys()
Dim MyGuys(3) As Person
For i = 0 To 3
MyGuys(i).strFName = Cells(i + 5, 1)
MyGuys(i).strLName = Cells(i + 5, 2)
MyGuys(i).strAddress = Cells(i + 5, 3)
MyGuys(i).strCity = Cells(i + 5, 4)
MyGuys(i).strState = Cells(i + 5, 5)
MyGuys(i).strZip = Cells(i + 5, 6)
Next i
End Sub
=======================
After I run Loadguys Macro (which loads variables from my ws
in the immediate window I enter:
? MyGuys(2).strAddress
But get r/t 9 - Subscript out of range..
Can someone tell me why? What am I omitting not
to be able to bring up mytext
TIA,
JIM