+ Reply to Thread
Results 1 to 6 of 6

Problems assigning value to an array: Run-Time error 9

  1. #1
    Registered User
    Join Date
    04-05-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Problems assigning value to an array: Run-Time error 9

    Code is below:

    Trying to read the value of a cell to put only unique values into an array for later uses.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Problems assigning value to an array: Run-Time error 9

    You can use this to remove duplicates
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-05-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problems assigning value to an array: Run-Time error 9

    Thanks a bunch. The first part (collection) is what I needed for now. Now to just figure out the remaining part...

  4. #4
    Registered User
    Join Date
    04-05-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problems assigning value to an array: Run-Time error 9

    I'm a bit confused why adding to a collection does not include duplicates but adding to an array does. I could not locate anything in the syntax description that states a collection would not include duplicates.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Problems assigning value to an array: Run-Time error 9

    A collection does not allow entries with duplicate keys; it generates a run-time error, and does not add the item.

    The On Error Resume Next statement suppresses the error.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Problems assigning value to an array: Run-Time error 9

    Unique values in column A to array sq
    Please Login or Register  to view this content.



+ 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