Sub list2()
With Cells(1, 2).Validation
.Delete
If Cells(1, 1) = "one" Then
.Add Type:=xlValidateList, Formula1:="A, B, C"
ElseIf Cells(1, 1) = "two" Then
.Add Type:=xlValidateList, Formula1:="D, E, F"
ElseIf Cells(1, 1) = "three" Then
.Add Type:=xlValidateList, Formula1:="G, H, I"
End If
End With
End Sub
The above example will only refresh when the macro is run. If you want this to run as soon as a value is chosen you may want to set this into the worksheet where an event will trigger it to run.
No comments:
Post a Comment