+ Reply to Thread
Results 1 to 9 of 9

Function to get Union of Ranges

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Function to get Union of Ranges

    I can make a union of ranges

    Please Login or Register  to view this content.
    But I want a inputbox to show and select the header rows of the columns I need in the union I got this far
    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Function to get Union of Ranges

    Try something like this (if i understood your question correctly).

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,194

    Re: Function to get Union of Ranges

    Think you'd need to do it like this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Function to get Union of Ranges

    I was a little unclean (sorry about that) I was hoping not to have to know in advance how many Sections in the union there were in advance of running the sub just to be able to select it as needed

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Function to get Union of Ranges

    Quote Originally Posted by capson View Post
    I was a little unclean (sorry about that) I was hoping not to have to know in advance how many Sections in the union there were in advance of running the sub just to be able to select it as needed
    You're still a little unclean. I don't know what that means. Sorry.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,194

    Re: Function to get Union of Ranges

    Do you mean this:

    Please Login or Register  to view this content.

    Regards, TMS

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Function to get Union of Ranges

    maybe so
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Function to get Union of Ranges

    Thanks you all

    nilem solution was what I was after

    again apologies about my lack of clarity in writing my question

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,194

    Re: Function to get Union of Ranges

    You're welcome. Thanks for the rep.


    No problem, glad you have a solution.

    Regards, TMS

+ 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. Using Union to combine ranges in VBA
    By sksachdev in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-27-2014, 06:59 AM
  2. Union of Named Ranges
    By justinv in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-12-2012, 12:52 PM
  3. Union Ranges Fail
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2011, 11:29 AM
  4. Union named Ranges
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2009, 01:03 AM
  5. With for multiple ranges (not using Union)
    By beeawwb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2008, 09:07 PM
  6. Setting Ranges With Union Method
    By Preston900 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2008, 09:17 AM
  7. [SOLVED] printing Union of Ranges
    By anny in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2006, 06:25 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