Hello!
I am playing for first time with userforms in VBA. I am trying to have 2 users forms: the first one to select a group of rows ("modules") to be deleted, and the second one to confirm the deletion. I want to see the result of the selection in the first user form in the second user form:
Userform1:
Private Sub CommandButton1_Click()
Range("BB8") = ListBox.Value --> the selection of the user from a list is pasted in cell BB8
UserForm1.Hide
UserForm2.Show
End Sub
Userform 2:
I have use a Listbox for showing the result of question 1:
Private Sub UserForm_initialize()
ListBox.AddItem Worksheets("Commercial").Range("BB8").Value
End Sub
So this works the 1st time I run the macro, but the second time I try to run it the ListBox for the Userfrom2 is equal to the selection made at the first time, so it is not changing, eventhought the value in the cell BB8 has change.
Some knows what I am missing?
Thanks!
IS
I am playing for first time with userforms in VBA. I am trying to have 2 users forms: the first one to select a group of rows ("modules") to be deleted, and the second one to confirm the deletion. I want to see the result of the selection in the first user form in the second user form:
Userform1:
Private Sub CommandButton1_Click()
Range("BB8") = ListBox.Value --> the selection of the user from a list is pasted in cell BB8
UserForm1.Hide
UserForm2.Show
End Sub
Userform 2:
I have use a Listbox for showing the result of question 1:
Private Sub UserForm_initialize()
ListBox.AddItem Worksheets("Commercial").Range("BB8").Value
End Sub
So this works the 1st time I run the macro, but the second time I try to run it the ListBox for the Userfrom2 is equal to the selection made at the first time, so it is not changing, eventhought the value in the cell BB8 has change.
Some knows what I am missing?
Thanks!
IS