我的OFFSET数据验证公式有什么问题?

时间:2017-11-04 05:21:14

标签: excel vba validation offset

我一直陷入OFFSET部分。当我手动尝试它时,它可以工作,当我用VBA尝试时它会卡住!

Range("C2").Activate
    With ActiveCell.Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
    xlBetween, Formula1:= _
    "=OFFSET(PARTSDB!$A$1;MATCH(CONCATENATE($E2;"" 
"";$F2);PARTSDB!$A:$A;0)-1;1;COUNTIF(PARTSDB!$A:$A;CONCATENATE($E2;"" 
"";$F2));1)"
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = "ERROR!!!"
    .InputMessage = ""
    .ErrorMessage = _
    "PART YOU ENTER DOESNT EXIST!!!"
    .ShowInput = True
    .ShowError = True
End With

0 个答案:

没有答案