+ Reply to Thread
Results 1 to 4 of 4

Combinations without repetition - VBA code partially working

  1. #1
    Registered User
    Join Date
    08-24-2014
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    18

    Combinations without repetition - VBA code partially working

    Hello,

    I am having an issue with creating a macro to find all the combinations possible without repetition.
    I have attached a sample of what my worksheet looks like and the macro that I managed to do but doesn't work correctly.

    Please Login or Register  to view this content.

    What I need for the code to do is this:
    I have a row ( "N" ) that has all the city names one under another, starting from position N7 and let's say it has these name: A B C D E
    In rows B and C, I need the macro to do this:
    Row B Row C
    A B
    A C
    A D
    A E
    B C
    B D
    B E
    C D
    C E
    D E

    I need all the combinations, without a repetition ( AB and BA have the same distance between them so it's pointless to have bouth)

    The VBA code that I wrote works perfectly for the first set ( AB / AC / AD / AE) but then for the next rows, it starts to overwrite the ones before so I think I need a limiter or another row count or something similar to that but I don't know where and how to modify it


    Please help
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Combinations without repetition - VBA code partially working

    Hi,

    Try this :

    Please Login or Register  to view this content.
    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    08-24-2014
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    18

    Re: Combinations without repetition - VBA code partially working

    Thanks, that works

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Combinations without repetition - VBA code partially working

    You are welcome, glad I can help.

    Regards

+ 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] Code only partially working
    By Saeber4777 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-11-2014, 10:53 PM
  2. [SOLVED] PC Macro only partially working on Macs
    By sdnorton in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2014, 01:38 PM
  3. Macro only partially working
    By LilSisKin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2013, 06:04 PM
  4. VLOOKUP partially working
    By ih8xc in forum Excel General
    Replies: 4
    Last Post: 05-03-2011, 08:32 PM
  5. Myrna Larson code for Combinations and Permutations not working in Excel 07-Overflow
    By PokerJoe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2009, 05:58 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