View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ndjxw17@yahoo.co.uk is offline
external usenet poster
 
Posts: 4
Default list box updating itself

what is a good way of removing a listbox selection from the list
i am using the following

private sub command button1 ()

dim selection

range("d4") = selection
range("a1").select

do until activecell.value = selection

activecell.offset(1,0).activate

loop

selection.entirerow.delete

end sub

as you can see i have set the control source of the listbox at d4
then i use that to find the row in the list and delete.

this works most of the time and the rows disapears off the list before
my eyes, however sometimes it stays there or freezes,

any hints or tips would be great, i am not sure if i should unload and
reload the form after i have deleted the row, so it resets the list.
i am really after abit of a better way of doing then i am at the moment

chris