Vivek Raaja
New Member
- Joined
- Dec 23, 2016
- Messages
- 1
Dear Experts,
Am looking forward to get clarified on a excel vba macros code.
Below is my actual requirement,
1. I will have 3 combobox (Which everything is inter dependent --- Combobox2 is dependent on Combobox1, Combobox3 is dependent on Combobox2)
2. I will have a textbox created at the bottom, where this should dynamically change according to the ComboBox selected
3. I will have a Command button at the bottom which should be the trigger point for the text in the texbox (mentioned above).
So Far i have written the following code
Private Sub ComboBox1_Change()
Dim index As Integer
index = ComboBox1.ListIndex
ComboBox2.Clear
Select Case index
Case Is = 0
With ComboBox2
.AddItem "Post"
.AddItem "Pre-post"
.AddItem "Revoke"
End With
With ComboBox3
.AddItem "Europe"
.AddItem "America"
.AddItem "Asia"
End With
Case Is = 1
With ComboBox2
.AddItem "Post"
.AddItem "Revoke"
End With
With ComboBox3
ComboBox3.Clear
End With
Case Is = 2
With ComboBox2
.AddItem "Post"
.AddItem "Revoke"
End With
With ComboBox3
ComboBox3.Clear
End With
End Select
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub CommandButton1_Click()
TextBox1.Text = "http://mrexcel.com/"
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "XXXXX"
.AddItem "YYYYY"
.AddItem "ZZZZZZ"
End With
End Sub
I couldn't able to dynamically connect the textbox to display the message based on the selection
Please be so kind in guiding me in a way to accomplish this task successfully
Many thanks for your feedback in advance!
Thanks & Regards
Vivek Raaja.B
Am looking forward to get clarified on a excel vba macros code.
Below is my actual requirement,
1. I will have 3 combobox (Which everything is inter dependent --- Combobox2 is dependent on Combobox1, Combobox3 is dependent on Combobox2)
2. I will have a textbox created at the bottom, where this should dynamically change according to the ComboBox selected
3. I will have a Command button at the bottom which should be the trigger point for the text in the texbox (mentioned above).
So Far i have written the following code
Private Sub ComboBox1_Change()
Dim index As Integer
index = ComboBox1.ListIndex
ComboBox2.Clear
Select Case index
Case Is = 0
With ComboBox2
.AddItem "Post"
.AddItem "Pre-post"
.AddItem "Revoke"
End With
With ComboBox3
.AddItem "Europe"
.AddItem "America"
.AddItem "Asia"
End With
Case Is = 1
With ComboBox2
.AddItem "Post"
.AddItem "Revoke"
End With
With ComboBox3
ComboBox3.Clear
End With
Case Is = 2
With ComboBox2
.AddItem "Post"
.AddItem "Revoke"
End With
With ComboBox3
ComboBox3.Clear
End With
End Select
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub CommandButton1_Click()
TextBox1.Text = "http://mrexcel.com/"
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "XXXXX"
.AddItem "YYYYY"
.AddItem "ZZZZZZ"
End With
End Sub
I couldn't able to dynamically connect the textbox to display the message based on the selection
Please be so kind in guiding me in a way to accomplish this task successfully
Many thanks for your feedback in advance!
Thanks & Regards
Vivek Raaja.B