+ Reply to Thread
Results 1 to 7 of 7

Removing items from listbox

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Removing items from listbox

    I have a listbox on an userform and it is populated from a range on a worksheet. I want to double click on selected item in my listbox to remove the item from the listbox and from the range.

    Thanks
    Last edited by jharaldson; 02-02-2013 at 08:44 PM.

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Removing items from listbox

    hi,

    You didn't attach any sample workbook so I will show You my idea.
    Let's say your source for listbox1.list is in the range of sheet1 A1:A5.
    List will be automaticaly load on userform initialize

    2 procedures for userform
    Please Login or Register  to view this content.
    and it is what You need I think
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Removing items from listbox

    Sorry MaczaQ,

    Here is a sample book. I need it to delete the whole row.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Removing items from listbox

    Sorry old workbook, this one is updated.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Removing items from listbox

    I added this to your code,
    Please Login or Register  to view this content.
    and that clears the row but now I want it to show on the sheet right away, not when I close the form. Is that possible?

  6. #6
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Removing items from listbox

    hi jharaklson,

    Sorry I've changed a bit Your code, below You will find an update; old lines I hash.
    For now that code get an array as listbox source from range (without any loop) and delete whole row when You will double click on listbox item
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Removing items from listbox

    thanks for your help macza!

+ 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