我一直陷入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