+ Reply to Thread
Results 1 to 3 of 3

delete rows of selected items on listbox

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    delete rows of selected items on listbox

    Dear all,

    here below my code to select listbox items and then delete the entire row.
    if i select a single item everithing works fine but if i select more than one item than the deleted rows are not the corresponding ones
    can someone help ....many tks

    Sub CommandButton4_click()
    Dim i As Integer
    
         For i = 0 To ListBox1.ListCount - 1
        
         If ListBox1.Selected(i) = True Then
        Range("a9:y1000").Cells(Me.ListBox1.ListIndex + 1, 1).EntireRow.Delete
         End If
         Next i    
       
     End Sub

  2. #2
    Registered User
    Join Date
    07-27-2014
    Location
    Saudi Arebia
    MS-Off Ver
    Microsoft 10
    Posts
    56

    Re: delete rows of selected items on listbox

    Dear Friend
    Let see the attached file
    I think it can help you

  3. #3
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: delete rows of selected items on listbox

    ...great ! Many many tks

+ 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] Add Selected Items From One ListBox to Another ListBox on UserForm
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 06:53 PM
  2. Delete rows that do not match items from listbox
    By pietras152 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-12-2013, 01:08 PM
  3. Copy Selected items from multicolumn, multiselect listbox to another listbox
    By Willigb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 11:27 AM
  4. Transfer random listbox items to new listbox and then loop through selected items
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2013, 05:58 PM
  5. How to use selected items from Listbox
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2006, 11: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