+ Reply to Thread
Results 1 to 5 of 5

Listbox not updating after when the command button is used more than once

  1. #1
    Registered User
    Join Date
    07-29-2021
    Location
    London, England
    MS-Off Ver
    2021
    Posts
    3

    Listbox not updating after when the command button is used more than once

    Hello, I have a tricky VBA problem to describe.

    I have created a userform that prompts the user to select answers from 3 comboboxes and sends their responses to an area of the worksheet. This is set up to populate a listbox in the userform, so the users can see a summary of their responses.
    The userform will display a messagebox if the user has left any of the comboboxes empty.

    The code below is for the command button that sends their responses. My problem is that the first time a user clicks on the command button, the listbox updates and everything works correctly. After the first time, the listbox stops updating although the userform continues to send the user's responses to the correct part of the spreadsheet. Does the 'screenupdating' function need to be looped?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Listbox not updating after when the command button is used more than once

    How is the listbox populated from the worksheet?
    Rory

  3. #3
    Registered User
    Join Date
    07-29-2021
    Location
    London, England
    MS-Off Ver
    2021
    Posts
    3

    Re: Listbox not updating after when the command button is used more than once

    Quote Originally Posted by rorya View Post
    How is the listbox populated from the worksheet?
    It's a named range using the formula below. The listbox also populates correctly if I close the userform and open it again.


    Please Login or Register  to view this content.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Listbox not updating after when the command button is used more than once

    Are you using that in the RowSource property, or using code in the Initialize event to populate it?

  5. #5
    Registered User
    Join Date
    07-29-2021
    Location
    London, England
    MS-Off Ver
    2021
    Posts
    3

    Re: Listbox not updating after when the command button is used more than once

    Quote Originally Posted by rorya View Post
    Are you using that in the RowSource property, or using code in the Initialize event to populate it?
    I'm using RowSource

+ 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. when command button is pressed a new row of text box and listbox appear
    By justlearning123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2015, 11:05 PM
  2. Populate listbox from command button using combobox
    By SamuelJackson in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-29-2014, 11:32 AM
  3. ListBox not updating after Save button
    By Blackbeginnings in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 01:00 PM
  4. how to add url links to listbox using command button
    By biznez1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 12:26 PM
  5. Making a command button and listbox disappear after use
    By benochs1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2013, 12:53 PM
  6. Listbox and Command Button
    By audioboxer in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-19-2012, 11:41 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