inactiveUser214710
Board Regular
- Joined
- Apr 27, 2012
- Messages
- 171
hi everyone
In my exemplification project I have two option box(opt1;opt2); two checkboxes(chk1;chk2) and a combobox(cbo1).
I have: A macro (rng) for checkbox1 and (rng2) for checkbox2.
When I choose opt1 and chk1, cbo1 shows the correct information, but when I change the option in checkbox the combo show repetations. Why?
There are something wrong, please help me to solve. thank you
In my exemplification project I have two option box(opt1;opt2); two checkboxes(chk1;chk2) and a combobox(cbo1).
I have: A macro (rng) for checkbox1 and (rng2) for checkbox2.
When I choose opt1 and chk1, cbo1 shows the correct information, but when I change the option in checkbox the combo show repetations. Why?
There are something wrong, please help me to solve. thank you
Code:
Private Sub chk1_Click()
If chk1.Value = True And chk2.Value = False Then
rng
End If
End Sub
Private Sub chk2_Click()
If chk2.Value = True Or chk1 - Value = False Then
rng2
End If
End Sub
=macros
Sub rng()
Dim rngCaixa As Range
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
For Each rngCaixa In ws.Range("caixa") 'range manager
UserForm1.cbo1.AddItem rngCaixa.Value
Next rngCaixa
End Sub
Sub rng2()
Dim rngbanco As Range
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
For Each rngbanco In ws.Range("banco") 'range manager
UserForm1.cbo1.AddItem rngbanco.Value
Next rngbanco
End Sub