View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Coddington Tim Coddington is offline
external usenet poster
 
Posts: 94
Default Listbox.RowSource problem

Given a simple form with one listbox, I have loaded the code as follows:

Private Sub UserForm_Initialize()
ListBox1.RowSource = "A1:A26"
End Sub
Private Sub ListBox1_Click()
ListBox1.RowSource = ""
ListBox1.RowSource = "A9:A14"
End Sub

where A1 .. A26 are the letters of the alphabet.
Question 1:
Putting a break in Listbox1_Click() shows that when I click on the listbox,
ListBox1_Click() fires two times. Why is that so?
Question 2:
When I click on the listbox, why aren't the contents of the listbox changed
to reflect the new rowsource?

Thanks for any help!
-Tim