+ Reply to Thread
Results 1 to 12 of 12

Listbox does not update using a dynamic named range with Offset function

  1. #1
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Listbox does not update using a dynamic named range with Offset function

    Hi All

    I have created a dynamic listbox (form control) which updates based on the named range,however when
    I incorporate the offset function to dynamically resize the list, the listbox fails to recognize the named range.
    I'm aware that using an Active X control with VBA, I can achieve the goal but just wanted if anybody could come up with a non vba solution.
    Any tips much appreciated.

    Thanks
    Last edited by Mysore; 01-15-2015 at 04:03 AM.
    Don't forget to rate 1 who helped u, using "Star"

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Listbox does not update using a dynamic named range with Offset function

    are you using this listbox on a sheet or userform?
    are you using the offset function in the named range or have you used the formula in the input range of the form control

    do you need a listbox? can you use data validation? i usually used a named range which has the formula in it.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Listbox does not update using a dynamic named range with Offset function

    I am using a List Box on a Sheet. The offset function is used in the named range and I would prefer to have a listbox cause I'm creating a dashboard.

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Listbox does not update using a dynamic named range with Offset function

    what formula are you using?

  5. #5
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Listbox does not update using a dynamic named range with Offset function

    i have tried this and it works
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Listbox does not update using a dynamic named range with Offset function

    Hi Sean

    Thanks for your feedback. I have no issues when there is a single list however with multiple lists, the listbox
    fails to recognize the named range. Attached is a sample file .
    Cheers
    Attached Files Attached Files

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Listbox does not update using a dynamic named range with Offset function

    Not sure I am getting enough of the whole picture. Would a 2 dimensional Dynamic Named Range be of use for populating the dependent list?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I've used these before and then referenced the columns of the named range with INDEX/MATCH combinations. You have a lookup value that shows in B1 resulting from the cell link in A1. I would think that could be of service for this.

    I've only used these in data validation / drop-downs.....never tried to apply them to form controls.

    To confirm that the formula works copy and paste it into the name drop down box and hit enter. That should select the current range of cities by country.
    Last edited by FlameRetired; 01-16-2015 at 03:28 AM.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Listbox does not update using a dynamic named range with Offset function

    OK. I tried something and I believe it does what you want.

    In addition to the Dynamic Named Range I posted in post #7 I added this Dynamic Named Range using INDEX / MATCH referencing the first DNR.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I named the first DNR CitiesByCountry. This one I named PickaCity. I applied
    it to the second listbox.

    I hope the rest explains itself. The file is attached.
    Attached Files Attached Files
    Last edited by FlameRetired; 01-16-2015 at 04:47 AM.

  9. #9
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Listbox does not update using a dynamic named range with Offset function

    Thanks mate. I tried populating additional entries under column G (ie List for Australia ) and it works, however when I update
    the other two, it fails.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Listbox does not update using a dynamic named range with Offset function

    Quote Originally Posted by Mysore View Post
    Thanks mate. I tried populating additional entries under column G (ie List for Australia ) and it works, however when I update
    the other two, it fails.
    Yes. I thought about that later (right after going to bed LOL).

    Am I to understand that if the other columns are longer than Australia they don't update? If that's the case it's because the 2D DNR's depth is defined off the left most column. I also lost sight of the fact that this is going to be a dashboard. That would likely be problematic for a 2D DNR, too. My apologies. I couldn't seem to get my thinking out of the land of data validation / drop-downs.

    As an afterthought the CitiesByCountry might work as a static range. You'd have to extend the range deep enough to meet anticipated additions. I haven't tried it yet. If that works I would anticipate second list box would have a lot of empty spaces at the bottom.

    I will try working it with static range as time permits.

    Glad to hear this much of it is working.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,745

    Re: Listbox does not update using a dynamic named range with Offset function

    Quote Originally Posted by Mysore View Post
    Thanks mate. I tried populating additional entries under column G (ie List for Australia ) and it works, however when I update
    the other two, it fails.
    I tried this with a static range $G$3:$I$20 replacing the 2D DNR equation. The second listbox updates no matter the number of row under any country up to 18 items. You'll need to manually expand the range to accommodate more than that.
    Last edited by FlameRetired; 01-16-2015 at 06:30 PM.

  12. #12
    Forum Contributor
    Join Date
    01-03-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2016,Excel 2013
    Posts
    186

    Re: Listbox does not update using a dynamic named range with Offset function

    Thanks buddy. For time being I might have to stick with Static range until I find a solution.
    Thank you all.

+ 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] ListBox rowsource named range offset by 1
    By Taemex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2014, 03:17 AM
  2. [SOLVED] Offset Dynamic Named Range
    By jwillis07 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-23-2014, 06:35 AM
  3. [SOLVED] Need a Dynamic Named Range; Offset/Match using 2 Columns
    By Kalithro in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-18-2013, 06:54 AM
  4. Named dynamic range using offset in VBA
    By craigmcewan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2011, 05:11 AM
  5. Dynamic named range & Offset
    By fastballfreddy in forum Excel General
    Replies: 1
    Last Post: 05-04-2006, 04:10 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