+ Reply to Thread
Results 1 to 5 of 5

Can't fill array with data

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    Hillsboro, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    11

    Can't fill array with data

    Please Login or Register  to view this content.
    After the line "Firstbook. activate", I am trying to loop through the data in an array. As I test this, Sales equals "J", which it should and Process equals "J" which it should not. The other "removed" statements all come up with "J" as well.

    I would like to load Sales, Process, Designation, Diameter, and Quantity with the data stored in the array. Maybe my array is too big and should only be one row tall?

    The problem area is in red though anything before it that should be cleaned up or done in some other fashion, you can let me know.

    Any help is always appreciated!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Can't fill array with data

    Please see the comments included below:
    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    01-23-2009
    Location
    Hillsboro, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Can't fill array with data

    Quote Originally Posted by protonLeah View Post
    Please see the comments included below:
    Please Login or Register  to view this content.

    Thank you very much for the commenting. I don't know this stuff very well at all and this will help a lot!

    I was told (somewhere, sometime) that I would learn more if I left option explicit and option base 1 out of things. Harder in the beginning, but better off in the end. I will be changing those numbers for a base of zero.

    I had figured out this one
    Please Login or Register  to view this content.
    but not the initial one. Probably because it is just checking for data or not.

    Trying to dimension all the sheets on one line - thought it could be done that way and it explains a few other things I haven't asked!

    As for the array being empty... well, I know. How do I fill it with the data from that range? What is it that I'm not doing or too stupid to remember? I have a hard time understanding things in the beginning, but, once I get it, I will have it like a bulldog!

  4. #4
    Registered User
    Join Date
    01-23-2009
    Location
    Hillsboro, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Can't fill array with data

    Is this a good way to populate the array with the cell values?

    Please Login or Register  to view this content.
    Last edited by RadBrad; 08-25-2009 at 01:32 AM.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Can't fill array with data

    The simplest method is to use a direct assignment:
    Please Login or Register  to view this content.
    Note: you really should not use Selection as a variable name as it's a keyword in Excel VBA.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1