LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete row from ListBox with RowSource enabled

Have A ListBox which is populated by the RowSource property
When trying to delete a selected row the following code only delete
the first row and not the selected row.

Private Sub cmddelrefresh_Click()
'Deletes items from randomize sheet shows in listbox
response = MsgBox(" delete " & ListBox1, vbOKCancel)
If response = vbCancel Then Exit Sub
'Sheets("Randomize").Activate
Range("Clubname").Select
For Each c In Range("Clubname")
If c.Value = ListBox1 Then
ActiveCell.EntireRow.Delete '(This always goes to top row of Range)
Exit For
End If
Next

End Sub

How is it possible to rectify this proble

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox rowsource on Userform Wendy Excel Discussion (Misc queries) 6 February 28th 08 05:46 PM
???Help??? Userform.Listbox.rowsource = ??? Steve Sparti Excel Discussion (Misc queries) 0 March 1st 06 09:44 PM
RowSource in ListBox aet-inc[_2_] Excel Programming 1 December 3rd 03 12:41 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
listbox rowsource Christy[_2_] Excel Programming 4 September 20th 03 11:44 PM


All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"