[英]Can you find my error in this simple Excel VBA syntax?
I am following this tutorials example for my Excel sheet, and getting Run-time error '1004': Application-defined or object-defined error.我正在为我的 Excel 工作表遵循本教程示例,并收到运行时错误“1004”:应用程序定义或对象定义错误。
Here is my VBA.这是我的 VBA。
Private Sub Worksheet_Calculate()
Worksheets("Input Quantities").Range("B51").Validation.InputMessage = Worksheets("Input Quantities").Range("B42")
End Sub
Notes (preserving the comments in an answer):注释(保留答案中的注释):
Range("B51")
doesn't have any validation applied.Range("B51")
没有应用任何验证,此代码将失败。 ( your original error ) Me
instead of Worksheets("Input Quantities")
.Me
而不是Worksheets("Input Quantities")
。 ( fixes the subscript out of range error - probably a misspelling of the sheet name, or a trailing space ).
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.