+ Reply to Thread
Results 1 to 6 of 6

Automatic update of list box with named range

  1. #1
    Registered User
    Join Date
    11-18-2013
    Location
    Zurich, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    54

    Automatic update of list box with named range

    I am using a userform with a list-box, populated by a range. The range is given by Offset and the formula works.
    The problem is when I insert a row through my form, the content of the list box is not updated. If I close the form
    and I open it again it works and the new row appears. How can it be updated automatically?

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Automatic update of list box with named range

    You'll just have to refresh the listbox.

    In the Worksheet_Change event, clear and reload the list.

    Use this function to check if the userform is loaded.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    11-18-2013
    Location
    Zurich, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Automatic update of list box with named range

    Thanks for the answer. I did the following inside the button code:

    Please Login or Register  to view this content.
    I am a little confused with Worksheet_Change event. Is it called automatically when something changes in your cells in the sheets?
    Because I tried it a bit it didn't work (most likely I had something wrong).

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Automatic update of list box with named range

    The code has to be on the sheet code page where the list resides.

    So, if your list is on Sheet1, so does the code have to be in the Sheet1 code page.

  5. #5
    Registered User
    Join Date
    11-18-2013
    Location
    Zurich, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Automatic update of list box with named range

    Thanks. Do you know if there is a way to make a macro run automatically in case of an event?
    I have created a macro and you have to click on a button once you have filtered a table, in order to run it. Can it be called automatically upon filtering the table,
    without clicking on the button?

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Automatic update of list box with named range

    Probably the best way to handle that is to have the macro to run the filter selection, then update the listbox afterward.

+ 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] Automatic update of the list range in DSUM
    By Paul Smith in forum Excel General
    Replies: 2
    Last Post: 03-03-2006, 05:40 PM
  2. Automatic update of list in Excel
    By Swampy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 PM
  3. Update range:How do I edit a Named Range using macro's
    By Tom Ogilvy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 PM
  4. [SOLVED] Automatic update of list in Excel
    By Swampy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. Automatic update of list in Excel
    By Swampy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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