1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Private Sub ComboBox1_Change()
Dim i As Integer, x As String, point As Integer, z As Integer
Me.ComboBox2.Clear
x = Me.ComboBox1.Value
point = Cells(11, 3).Value
z = 17
For i = 1 To point
If Sheets(1).Cells(z, 1).Text <> x Then
Me.ComboBox2.AddItem Sheets(1).Cells(z, 1)
z = z + 2
End If
Next i
End Sub
Private Sub UserForm_Initialize()
Dim point As Integer, i As Integer, x As Integer
point = Cells(11, 3).Value
x = 17
For i = 1 To point
Me.ComboBox1.AddItem Sheets(1).Cells(x, 1).Text
x = x + 2
Next i
End Sub |
Partager