excel - 找不到运行时错误-2147221080 (800401a8)
问题描述
请我需要帮助来解决此代码,以查找多个工作表中的客户是否存在于另一个工作簿的客户列表中,但我有这个问题,即在运行代码时出现“自动化错误”
Sub checkcustomerID()
On Error Resume Next
Dim y As Workbook
Dim x As Workbook
Set y = ActiveWorkbook
Set x = Workbooks.Open("\\Eng_badia-pc\e\WALEED SOBEH ENGINEERING OFFICE\W-01-ADMINSTRATIVE DEPARTMENT\W-01-AD-1-SALES\W-01-D1-S1-STATMENTS\03-PROJECTS TRACKER.xlsm")
'-------------------------------------- 'Inspect matching of values of multible cells in _
workbook1 to row in another workbook
For i = 1 To y.Sheets.Count
For j = 1 To x.Sheets.Count
FS1 = y.Sheets(i).Range("b3").Value
FS2 = y.Sheets(i).Range("b6").Value
FS3 = y.Sheets(i).Range("e6").Value
FS4 = y.Sheets(i).Range("h6").Value
FS5 = y.Sheets(i).Range("b7").Value
FS6 = y.Sheets(i).Range("h7").Value
FS7 = y.Sheets(i).Range("e7").Value
R1 = x.Sheets(j).Range("d:d").Value
R2 = x.Sheets(j).Range("m:m").Value
R3 = x.Sheets(j).Range("n:n").Value
R4 = x.Sheets(j).Range("o:o").Value
R5 = x.Sheets(j).Range("p:p").Value
R6 = x.Sheets(j).Range("q:q").Value
R7 = x.Sheets(j).Range("r:r").Value
If FS1 = R1 And FS2 = R2 And FS3 = R3 And _
FS4 = R4 And FS5 = R6 And FS6 = R6 And FS6 = R6 Then
MsgBox "The Customer " & "" & x.Sheets(j).Range("d" & j) & "and have Customer ID:" & x.Sheets(j).Range("b" & j)
Sheets(i).Names = x.Sheets(j).Range("b" & j + 3)
Else:
MsgBox "New Customer "
End If
Next j
Next i
解决方案
推荐阅读
- nginx - 如何根据 url 参数更改 Nginx 中的别名?
- sql - 如何在sql server新版本中使用域完整性约束和断言约束
- java - 带有轮数显示的重复倒计时计时器
- here-api - 反向地理编码 - 无法建立连接,因为目标机器主动拒绝它'
- node.js - 我在 Heroku 上部署了我的应用程序,但后来我遇到了 cors 问题
- android - 如何在android studio中调用API从openweathermap.org收集json信息
- git - Git for Visual Studio 的烦恼
- react-native - 无法访问导航道具
- image-processing - Tesseract 的页面分割模式 1 (--psm 1) 和图片去歪斜效果一样吗?
- python - 我们如何将python2链接到python?