Jul 26th, 2005, 09:30 AM
#1
Thread Starter
New Member
excel combo box opening userform ?????
i have an excel sheet with a combo box containing a list of names on it. when i click on a name in the combo box i would like a specific userform to appear, this is probably a pretty basic problem but i would like to know how to write the code for this.
Jul 27th, 2005, 09:26 AM
#2
Lively Member
Re: excel combo box opening userform ?????
Assuming your combobox is from the control toolbox:
VB Code:
Option Explicit
Private Sub ComboBox1_Change()
Select Case ComboBox1.Value
Case "MyForm"
UserForm1.Show
Case "YourForm"
UserForm2.Show
Case "ThisForm"
UserForm3.Show
End Select
End Sub
Attached Files
Jul 28th, 2005, 03:42 AM
#3
Thread Starter
New Member
Re: excel combo box opening userform ?????
thanks very much justin but the combobox isnt from the control toolbox, its a different type of combobox
Last edited by boylynch; Jul 28th, 2005 at 03:47 AM .
Jul 28th, 2005, 05:46 AM
#4
Thread Starter
New Member
Re: excel combo box opening userform ?????
its an excel drop down list box, i think its of the type made with data validation, not quite sure.
Jul 28th, 2005, 07:19 AM
#5
Lively Member
Re: excel combo box opening userform ?????
If it's validation
VB Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> Range("C1").Address Then Exit Sub
Select Case Target.Value
Case "Userform1"
UserForm1.Show
Case "Userform2"
UserForm2.Show
Case "Userform3"
UserForm3.Show
End Select
End Sub
Attached Files
Jul 28th, 2005, 08:22 AM
#6
Thread Starter
New Member
Re: excel combo box opening userform ?????
I think that could be it, ill work on it and reply in the meantime.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width