목록 상자 대신 ComboBox를 사용하면 더 쉬울 것입니다. 속성 콤보의 윈도우를 선택 스타일 2로 이동, 그에 따라
Private Sub ComboBox_FruitsVegetables_Change()
ComboBox_ChoosenFruitOrVegetable.Clear
With ComboBox_ChoosenFruitOrVegetable
If ComboBox_FruitsVegetables.Value = "Fruit" Then ' 1. If ComboBox_FruitsVegetables.Value = "Fruit"
.AddItem ("my fruit") 'add items per fruit
.Value = "my fruit"
ElseIf ComboBox_FruitsVegetables = "Vegetables" Then ' 1. If ComboBox_FruitsVegetables.Value = "Fruit"
.AddItem ("my veggy") 'add items per veggies
.Value = "my veggy"
End If ' 1. If ComboBox_FruitsVegetables.Value = "Fruit"
End With
End Sub
당신이 VBA 추가 만 값으로 선택을 제한하기 위해 과일과 야채의 "변화"이벤트를 얻고 다른 하나를 채울 허용되는 여러 선택 사항으로 인해 목록 상자가있는 경우 알려주십시오. 텍스트는 "하나 선택"을 요청하기 때문에 생각하지 않았습니다.
[this help] (http://www.contextures.com/xlDataVal02.html)가 있습니까? – BruceWayne
@BruceWayne은 폼 컨트롤에 없습니다. – Gareth
예, 감사합니다! – user6273755