dynamic drop downs

L

lumpy04

I trie d this code:

Private Sub Project_Change()
If Image.Text = "IPSD Base" Then
Project.List = Array("NA")
Else
If Image.Text = "CPSE Base" Then
Project.List = Array("NA")
Else
If Image.Text = "CPSE Development" Then
Project.List = Array(" ", "AMA", "ATHN", "Feller", "Future
Phoenix", "Janus", "K700", "KMS", "MEGA", "PSD", "SEBR")
End If
End If
End If
End Sub

It compiles ok, but is not dynamic. Basically, 2 drop down boxes,: "Image"
and "Project". I would like the choices in "Project" to be dependant on the
choice in "Image"
 
G

Greg Maxey

I assume that you are using a UserForm?

Private Sub Image_Change()
Select Case Me.Image.Value

Case "IPSD Base"
With Me.Project
.Clear
.AddItem "N/A"
End With
Case "CPSE Base"
With Me.Project
.Clear
.AddItem "N/A"
End With
Case "CPSE Development"
With Me.Project
.Clear
.List = Split(" ,AMA,ATHN,Feller,Future
Phoeni,Janus,K700,KMS,MEGA,PSD,SEBR", ",")
End With
End Select
End Sub
Private Sub UserForm_Initialize()
Me.Image.List = Split("IPSD Base,CPSE Base,CPSE Development", ",")
End Sub
 
L

lumpy04

Thank you very much for your reply. The code worked beautifully, and ended a
6 hour internet browsing marathon for the solution.
 
G

Greg Maxey

Your welcome. I looks like if you had checked back earlier you might
have saved about 5 hours of search time ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top