我正在尝试生成一个代码,该代码将为我的电子表格提供一个下拉列表。我有一个很长的公式,并且尝试使用各个社区中显示的休息时间,但是该公式无法正常工作。我是VBA编码的新手,以下是我的能力。 帮助或建议,将不胜感激。
Sub Trial()
'
' Trial Macro
'
'
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:= _
"= If _
("IF($B$57=Sheet1!$N$17,Sheet1!N18,IF($B$57=Sheet1!$O$17,Sheet1!O18, _
IF($B$57=Sheet1!$P$17,Sheet1!P18,IF($B$57=Sheet1!$Q$17,Sheet1!Q18, _
IF($B$57=Sheet1!$R$17,Sheet1!R18,IF($B$57=Sheet1!$S$17,Sheet1!S18, _
IF($B$57=Sheet1!$T$17,Sheet1!T18,IF($B$57=Sheet1!$U$17,Sheet1!U18, _
IF($B$57=Sheet1!$V$17,Sheet1!V18,IF($B$57=Sheet1!$W$17,Sheet1!W18, _
IF($B$57=Sheet1!$X$17,Sheet1!X18,IF($B$57=Sheet1!$Y$17,Sheet1!Y18, _
IF($B$57=Sheet1!$Z$17,Sheet1!Z18,IF($B$57=Sheet1!$AA$17,Sheet1!AA18, _
IF($B$57=Sheet1!$AB$17,Sheet1!AB18,IF($B$57=Sheet1!$AC$17,Sheet1!AC18, _
IF($B$57=Sheet1!$AD$17,Sheet1!AD18,IF($B$57=Sheet1!$AE$17,Sheet1!AE18, _
IF($B$57=Sheet1!$AF$17,Sheet1!AF18,IF($B$57=Sheet1!$AG$17,Sheet1!AG18, _
IF($B$57=Sheet1!$AH$17,Sheet1!AH18,IF($B$57=Sheet1!$AI$17,Sheet1!AI18, _
IF($B$57=Sheet1!$AJ$17,Sheet1!AJ18,IF($B$57=Sheet1!$AK$17,Sheet1!AK18, _
IF($B$57=Sheet1!$AL$17,Sheet1!AL18,IF($B$57=Sheet1!$AM$17,Sheet1!AM18, _
IF($B$57=Sheet1!$AN$17,Sheet1!AN18,IF($B$57=Sheet1!$AO$17,Sheet1!AO18, _
IF($B$57=Sheet1!$AP$17,Sheet1!AP18, _
IF($B$57=Sheet1!$AQ$17,Sheet1!AQ18,"")))))))))))))))))))))))))))))) = ""Mixer_11"","""")"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
结束子