Excel精英培训网

 找回密码
 注册
查看: 1393|回复: 0

[无附件] 以下代码标红出错,错误是对象变量with未定义,求大神帮助

[复制链接]
发表于 2020-3-1 22:53 | 显示全部楼层 |阅读模式
  1. <div>以下代码标红出错,错误是对象变量with未定义,求帮助</div><div>
  2. </div><div>Sub t2()
  3. </div>Dim i As Integer
  4. Dim r As Integer
  5. Dim s As Integer
  6. With Sheets("roa2")
  7. For i = 2 To 302
  8.   r = Application.WorksheetFunction.CountIf(.[a:a], Cells(i, "a"))
  9.   If r = 0 Then
  10.   GoTo 100
  11.   Else
  12. <font color="red">   s = .[c:c].Find(Range("d" & i), SearchDirection:=xlNext).Row '错误91</font>
  13.    Cells(i, "n") = .Cells(i - 2, "d")
  14.    Cells(i, "o") = .Cells(i - 1, "d")
  15.    Cells(i, "p") = .Cells(i + 1, "d")
  16.    Cells(i, "q") = .Cells(i + 2, "d")
  17. End If
  18. 100:
  19. Next i
  20. End With
  21. End Sub
复制代码



excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-7 15:56 , Processed in 0.171416 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表