+ Reply to Thread
Results 1 to 3 of 3

Arrays - Redim Preserve

  1. #1
    Forum Contributor
    Join Date
    09-17-2014
    Location
    UK
    MS-Off Ver
    2007
    Posts
    117

    Arrays - Redim Preserve

    The concept eventually is to load data into an array from multiple worksheets, and output the duplicates into a new sheet.

    I'm loading the data into the array as dynamic ranges - I'll load from the first sheet, then Redim Preserve the array based on the last used row of the next sheet to be loaded in.

    I'm struggling with the Redim Preserve element as it's giving me a subscript out of range error.

    Please Login or Register  to view this content.
    Other examples I've researched appear to follow this but I can't get it to work - where am I going wrong?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Arrays - Redim Preserve

    You've created a two dimensional array while reading from a range (cannot resize two dimensional arrays ).

    Try:
    Please Login or Register  to view this content.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  3. #3
    Forum Contributor
    Join Date
    09-17-2014
    Location
    UK
    MS-Off Ver
    2007
    Posts
    117

    Re: Arrays - Redim Preserve

    Thanks - I should have realised this after the amount of reading I did before posting.

    My plan was to load several worksheets into an array to find duplicates and return the worksheet names where the duplicates appear, however I'll stick to looping through worksheets for now, until I have some time to do more research into arrays.

    Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ReDim Preserve problem
    By randomdude in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-25-2014, 05:40 AM
  2. redim preserve error
    By ggabi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2012, 03:00 AM
  3. dynamic arrays, redim preserve
    By pjjclark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2007, 07:35 PM
  4. Redim Preserve 2D Array
    By kraljb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2006, 03:23 PM
  5. [SOLVED] redim preserve
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2005, 09:45 AM

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