LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Creating working with Class

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating UDF by Class Module (Leo)? Leo Excel Discussion (Misc queries) 1 December 2nd 08 10:59 AM
What is the advantage of creating this Class. WhytheQ Excel Programming 0 February 28th 08 03:14 PM
Creating a collection in a class Memento Excel Programming 3 June 20th 07 10:45 AM
Class stops working Gary Brown[_5_] Excel Programming 5 April 28th 05 08:38 PM
Class module creating OLEObject Erich Neuwirth Excel Programming 0 August 11th 04 12:43 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"