+ Reply to Thread
Results 1 to 2 of 2

List box values updating but text is not updating

  1. #1
    Registered User
    Join Date
    09-16-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question List box values updating but text is not updating

    HI All,

    THE SETUP
    I have a multicolumn list box which is populated with selected non-sequential columns from an excel worksheet. The worksheet is passed to the function(register), row is not currently used.
    Output Jobs is the name of the list box on the user form.

    I use the code below to populate the list box when the user form is first loaded. No problems at all.

    THE PROBLEM
    After an entry is entered(a job) by the user it is entered into the worksheet (register), I then call this code again to update the list box, without closing the user form. The register sheet is closed after entry of the new job into the file adn opened again to update the list box.
    The list box values update but the text is left completely blank, i.e I can select the updated values there is just no text for them.

    If I remove the OutputJobs.clear statement and remove each item individually then add the new items, the old text appears in the list box, but the new selection value is there when you click, so everything is shifted by one, and the new text value appears at the bottom of the list.

    The only way I can update the listbox correctly is to close the userform and reload it which I do not want to do.

    THE CODE
    Please Login or Register  to view this content.
    All I want is the list box to show the correct text when the values are updated, can anyone help I have searched hundreds of threads but found nothing that would work.

    Thanks for in advance for your time and help,
    Shane

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: List box values updating but text is not updating

    Hello Shane,

    You need to force the UserForm to update the ListBox control's display value. You can this by adding the statement Me.Repaint after you have reloaded the ListBox.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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