我不知道如何根据某个单元格值创建下拉列表。我有这两个功能,但不知道如何合并它们。
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C14")) Is Nothing Then
Select Case Range("C14")
Case "Emergency": EmergencyError
Range("C18") = "No"
'Case "Basic": ??
'Stops Select Case statement
End Select
End If
End Sub
Sub BasicList()
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=DONNEES!$A$4:$A$10"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub
要创建的下拉菜单位于另一个单元格上,唯一的单元格是相同的。