Hello tmonteit,
You can use the following code in the "Private Sub Worksheet_Change(ByVal Target As Range)" worksheet procedure. This sub fires when you change a cell (type something in and press <Enter> or otherwise leave the cell), and it gives you the address of the cell that was changed.
Code in there will fire every time you change any cell, but we can tell it that we're only interested in certain cells changing; for example, say you want to type "colors" or "volume" in cell A1 to get one of the drow-down menus you mention above to appear in cell C1:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
'If it wasn't cell A1 that was changed, the rest is ignored
Target.Offset(0, 2).Select
With Selection.Validation
.Delete
If Target = "colors" then
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertSt
xlBetween, Formula1:="Red,Amber,Green
Else
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertSt
xlBetween, Formula1:="High,Med,Low"
End If
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End Sub
Hope that helps!
Main Topics
Browse All Topics





by: roos01Posted on 2007-10-18 at 22:02:19ID: 20106753
Did you try to work wwith validaiton lists?
Asume thie following:
1. Value which results in different list value = Cell A1
2. you have 2 list, use defined name like: COLOR and SEVERITY
3. create these defined lists
4. asume that you need in cell B1 the dropdown
5. select B1: from menu: Data>>Validation>>Allow List
6. Enter the formula: =IFA1=1,COOR,SEVERITY)
now if A1 contains a 1 then the colors are shown, otherwise the HIGH, MEDIUM and low will be shown.
I hope this works for you
regards,
Jeroen