+ Reply to Thread
Results 1 to 11 of 11

Inputbox, Union and non-contiguous ranges

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    SL
    MS-Off Ver
    Excel 2010
    Posts
    10

    Inputbox, Union and non-contiguous ranges

    Hello,
    How do I set a range such that when the user sees the input box he can select no contiguous cells. How can these cells be united into a simple united range.

    I tried this but no luck :

    Please Login or Register  to view this content.
    Your help is appreciated.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Inputbox, Union and non-contiguous ranges

    Are the responses at
    http://www.mrexcel.com/forum/excel-q...box-union.html

    helping?
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

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

    Re: Inputbox, Union and non-contiguous ranges

    Cross-posted and answered at http://www.mrexcel.com/forum/excel-q...ml#post3773187
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-02-2014
    Location
    SL
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Inputbox, Union and non-contiguous ranges

    Thanks for the suggestions. My code is already written to access elements in the range (rng(i)). If I select the first 5 contiguous cells and then select another cell that is not contiguous and say rng(6) it returns a cell that I didn't even select which is the cell contiguous with the first 5 that I selected.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-02-2014
    Location
    SL
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Inputbox, Union and non-contiguous ranges

    Please why no answer ?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inputbox, Union and non-contiguous ranges

    Crossposting on multiple forums usually works against you, no one wants to spend time working (for free!) on a problem you're working on other sites, too. Feels like a complete waste of time, our time that is.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  7. #7
    Registered User
    Join Date
    04-02-2014
    Location
    SL
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Inputbox, Union and non-contiguous ranges

    Well I never knew that MrExcel and Excel forum were the same sites or interrelated. And also I posted the question first on Mr. Excel. It was the third thread that I have created and for the third time nobody answered. So I decided to post here, given that here too is a place where one is allowed to post questions. I have no idea why I don't get answers at MrExcel.com and I hope not to use their forums again. So I hope I'm understood.

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Inputbox, Union and non-contiguous ranges

    While not related, a lot of the answerers visit both Mr. Excel and Excel Forum. This link explains why and how cross posting can be done to your advantage. As it is, no one thinks poorly of a (first time) cross poster. We do think that a first time cross poster is inexperienced in getting help from Excel forums, hence my link to this article

    http://www.excelguru.ca/content.php?184

  9. #9
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Inputbox, Union and non-contiguous ranges

    In general when one is working with discontinuous ranges, one has to loop through the Areas of the range.

    It sounds like your issue isn't with the InputBox getting the discontinuous range, but the handling of that range once gotten from the user.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inputbox, Union and non-contiguous ranges

    I admit, I tried to cycle through the areas of a selected range using the InputBox to test for ranges with more than one cell in the "area", if they select the contiguous cells one at a time it puts a comma between them and thus the Range definition stores them as separate areas so that didn't work.

  11. #11
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: Inputbox, Union and non-contiguous ranges

    what are you trying to do with the ranges?
    it might be easier to split the selection into an array or ranges and cycle throught them.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

+ 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] Copying (non-contiguous) headers to next sheet: errors with Union method
    By k64 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2013, 12:07 PM
  2. [SOLVED] Union non-contiguous range
    By cokillerliu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2013, 10:38 AM
  3. Union of Named Ranges
    By justinv in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-12-2012, 12:52 PM
  4. Union Ranges Fail
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-19-2011, 11:29 AM
  5. Copy and Paste an array (contiguous & non contiguous ranges)
    By Xrull in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2010, 09:17 AM

Tags for this Thread

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