I have
ComboBox1 and CheckBox1
Private Sub UserForm_Initialize()
With Me.ComboBox1
.Clear
.ColumnCount = 3
.ColumnWidths = "50;0;0"
.AddItem "Hi"
.AddItem "Bye"
.AddItem "See Ya"
.Column(1, 0) = 1
.Column(1, 1) = 2
.Column(1, 2) = 3
.Column(2, 0) = "iH"
.Column(2, 1) = "eyB"
.Column(2, 2) = "aY eeS"
End With
End Sub
I select Hi from the list.
If I click CheckBox1=True I want Me.ComboBox1.Value = "iH" .Column 2 value
If I click CheckBox1=False I want Me.ComboBox1.Value = "Hi" .Column 0 value
The use case for this is... I will additem a list in Greek terminology. If I click the CheckBox it will show the English equivalence.
Private Sub CheckBox1_Click()
Dim a As String
a = getAlternateDescription
Me.ComboBox1.Value = a
End Sub
Private Property Get getAlternateDescription() As String
getAlternateDescription = Me.ComboBox1.List(Me.ComboBox1.ListIndex, 2)
End Property
I get an error on line Me.ComboBox1.Value = a
Could not set the Value property. Invalid property value.
Any thoughts on how this could be done?
Thanks,
stapuff
ComboBox1 and CheckBox1
Private Sub UserForm_Initialize()
With Me.ComboBox1
.Clear
.ColumnCount = 3
.ColumnWidths = "50;0;0"
.AddItem "Hi"
.AddItem "Bye"
.AddItem "See Ya"
.Column(1, 0) = 1
.Column(1, 1) = 2
.Column(1, 2) = 3
.Column(2, 0) = "iH"
.Column(2, 1) = "eyB"
.Column(2, 2) = "aY eeS"
End With
End Sub
I select Hi from the list.
If I click CheckBox1=True I want Me.ComboBox1.Value = "iH" .Column 2 value
If I click CheckBox1=False I want Me.ComboBox1.Value = "Hi" .Column 0 value
The use case for this is... I will additem a list in Greek terminology. If I click the CheckBox it will show the English equivalence.
Private Sub CheckBox1_Click()
Dim a As String
a = getAlternateDescription
Me.ComboBox1.Value = a
End Sub
Private Property Get getAlternateDescription() As String
getAlternateDescription = Me.ComboBox1.List(Me.ComboBox1.ListIndex, 2)
End Property
I get an error on line Me.ComboBox1.Value = a
Could not set the Value property. Invalid property value.
Any thoughts on how this could be done?
Thanks,
stapuff