Results 1 to 4 of 4
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Array Variables in Excel 2003?

    I can poke my way through a lot of simple VBA, but my foundation in it is weak. Maybe this is a silly question:

    Does VBA have Array variables like those in early versions of BASIC? If so, how are they dimensioned and referenced?

    I want to have an array something like Alphabet(X,Y), with X dimensioned as 2 and Y as 26.

    Alphabet(1,n) would contain the letters of the alphabet, in A through Z sequence, in Alphabet(1,1) through Alphabet(1,26)

    Alphabet(2,n) would contain the same letters, but in different order, in Alphabet(2,1) through Alphabet(2,26)

    If I knew a little about the syntax, etc., I'm sure I could program what I need.

    Also, what are some good books on VBA, particularly for Excel?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Yes, an Array is a basic type in VBA. This MSDN section might be helpful: Getting the Most Out of Visual Basic for Applications > Understanding Arrays.

  3. The Following User Says Thank You to jscher2000 For This Useful Post:

    Lou Sander (2011-08-02)

  4. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    Lou,

    See this thread for recommendations on books. You can also search on VBA +Books +Excel
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. The Following User Says Thank You to RetiredGeek For This Useful Post:

    Lou Sander (2011-08-02)

  6. #4
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts
    Thanks, guys! This is exactly what I needed.

    VBA arrays work like what I remember, (though the explanations aren't 100% easy to figure out), and I'm using them already in my little worksheet application.

    And there are jillions of books, so recommendations are priceless. I already have "Writing Excel Macros," (from Y2K) which I had totally forgotten about and whose current version is on the recommendation list. Ditto a 1999 edition of "VBA for Dummies." That old stuff is still good at a basic level (no pun intended), so it's very helpful.
    Last edited by Lou Sander; 2011-08-02 at 09:21.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •