+ Reply to Thread
Results 1 to 5 of 5

Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

  1. #1
    Registered User
    Join Date
    01-05-2008
    Posts
    51

    Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

    Hi Gurus,

    I need guidance or the following requirement.

    I have multiple of named ranges that are to be merged, de-duplicated and updated back to all of those ranges again. Example: I am adding the following screenshots to understand the before and after running the macro.
    Before:
    Attachment 546242

    After:
    Attachment 546243

    Basically, it is merging, de-duplicating and updating back to the same named ranges. As list of columns need to be compared is huge and in various combination, I thought using ADO solves my problem quickly. SQL Union results in mergin and de-duplication automatically. I am able to achieve this very quickly. Only problem is that, those columns outside the first 256 columns of spreadsheet are resulting in error. Please find the attached sample file with ADO solution.

    ADO On Excel - Sample file.xlsm

    Is there a way to overcome this issue with ADO or any other suggestions to deal this with VBA code?

    Thanks for all your help.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

    Power Query will do, but you got to have excel 2016 which has Power Query built-in it. If you have excel 2013, you still can use Power Query, but it is not part of excel, so you have to download it as add-ins.
    Power Query has all the union, merge, append and join functions.

  3. #3
    Registered User
    Join Date
    01-05-2008
    Posts
    51

    Re: Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

    Hi AB33,

    This is more of a VBA problem. There is a huge list of Named ranges which has a certain logic to loop through and comparing between related lists. The goal is to make sure the lists are up-to-date. The only complexity is to compare between multiple lists. Could you suggest VBA alternative using Arrays to merge and de-duplicate between multiple lists and updating them back to the named ranges compared?

    Thank you.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

    Well, What ever you could using ADO could now be done using Power Query, but without writing any code. Access has a 256 columns limits, that is the reason for getting an error once you are over the limit. If your data is in excess of 256 columns, no amount of array would be an ideal solution. I suspect you are using a wrong tool and should look at Power Query.

  5. #5
    Registered User
    Join Date
    01-05-2008
    Posts
    51

    Re: Need ADO alternative VBA to merge and remove duplicates of multiple Named Ranges

    Hi AB33,

    I think you got the wrong perspective of my problem. I am not trying to merge 256 columns. I am trying to merge only 2-4 columns at a time. Though the problem is that there are more than 500 columns which needs to be tackled in a loop. What columns needs to be merged and updated, will be decided a settings sheet which has the list of all Named Ranges from Sheet1. This specific logic to loop is already in place.

    Power query is a powerful tool with nice features, but still I need to iterate through all the 200 iterations of comparisons manually which is not a usable solution. Even if there is a way to automate using Power Query, I am stuck with MS Office 2010 version.

    That is the reason, I am looking for some solution using VBA/Arrays to tackle these individual iterations of Merging/De-duplication/Updating the columns. I am not very proficient using Arrays, so sought help from the forum.

    Hope this clarifies my position.

    Thank you.

+ 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. Remove duplicates from multiple ranges
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2017, 04:25 PM
  2. [SOLVED] Merge .csv columns and remove duplicates
    By Catman Begins in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-30-2015, 07:13 AM
  3. Remove underscore when using named ranges for dynamic lists
    By stromley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2015, 04:14 PM
  4. merge 2 named ranges
    By roland willems in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-10-2008, 08:53 AM
  5. Remove duplicates from col.A and merge col.B
    By wali in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-13-2008, 04:54 PM
  6. Union Ranges and remove duplicates
    By hydrojoe11 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2008, 05:28 PM
  7. Merge and Remove Duplicates in Excel List
    By ericgcollyer in forum Excel General
    Replies: 8
    Last Post: 05-14-2007, 11:33 PM

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