|
- <div>以下代码标红出错,错误是对象变量with未定义,求帮助</div><div>
- </div><div>Sub t2()
- </div>Dim i As Integer
- Dim r As Integer
- Dim s As Integer
- With Sheets("roa2")
- For i = 2 To 302
- r = Application.WorksheetFunction.CountIf(.[a:a], Cells(i, "a"))
- If r = 0 Then
- GoTo 100
- Else
- <font color="red"> s = .[c:c].Find(Range("d" & i), SearchDirection:=xlNext).Row '错误91</font>
- Cells(i, "n") = .Cells(i - 2, "d")
- Cells(i, "o") = .Cells(i - 1, "d")
- Cells(i, "p") = .Cells(i + 1, "d")
- Cells(i, "q") = .Cells(i + 2, "d")
- End If
- 100:
- Next i
- End With
- End Sub
复制代码
|
|