qq_39943601 2021-06-22 16:02 采纳率: 50%
浏览 501
已采纳

VBA子过程或函数未定义 怎么解决?


Private Sub CommandButton3_Click()
Dim myarr, mybrr()
ReDim mybrr(0)

myarr = Range("H3:L5")

Set myadic = CreatObject("scripting.dictionary")
Set mybdic = CreatObject("scripting.dictionary")
Set mycdic = CreatObject("scripting.dictionary")

For i = 1 To UBound(myarr)
If myarr(i, 1) <> "" Then myadic(myarr(i, 1)) = ""
Next i

For i = 1 To UBound(myarr)
If myarr(i, 2) <> "" And myadic.exists(myarr(i, 2)) Then
mybdic(myarr(i, 2)) = ""
End If
Next i

k = 0
For i = 1 To UBound(myarr)
If myarr(x, 3) <> "" And mybdic.exists(myarr(i, 3)) Then
k = k + 1
ReDim Preserve mybrr(k)
mybrr(k) = myarr(i, 3)
mycdic(myarr(i, 3)) = ""
End If
Next i

[V2].Resize(k + 1, 1) = Application.Transpose(mybrr)
[W2].Resize(mycdic.Count, 1) = Application.Transpose(mycdic.keys)
End Sub

  • 写回答

1条回答 默认 最新

  • 碰碰虎 2021-06-22 22:04
    关注

    把CreatObject 改正成CreateObject。单词拼写错误

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 python 怎么连接 SQLITE3
  • ¥20 创建taro项目,在vscode上能够写跨平台写微信小程序代码
  • ¥15 网站出现错误跳转问题
  • ¥15 Docker容器里已经安装了ssh,但打包迁移到新机器一直容器一直提示unrecognized service。
  • ¥15 综合布线实例设计,就好看好看不恐怖可好滤镜好聚
  • ¥15 使用moviepy库视频合并时出错
  • ¥30 FLUENT液固传质UDF
  • ¥15 怎么看梯度直方图以,怎么判断梯度消失/爆炸,怎么解决
  • ¥15 aspnetdll文件访问拒绝
  • ¥15 wpf中在模版中寻找元素