0
请帮助调试:运行时错误“438”对象不支持此属性或方法Excel的VBA:运行时错误“438”对象不支持此属性或方法带有“范围”
我不知道为什么我的声明Set ImCrazy = .Find(“Total”)不起作用。
“总计”是约23个细胞的一部分。我基本上要找到每一个,选择它,然后将1个细胞在和输入功能等
Sub Utilization()
'Utilization Macro
'Keyboard Shortcut: Ctrl+u
Dim lastRow As Long
Dim x As Integer
Dim knt As Integer
Dim ImCrazy As Range
With ActiveSheet
ActiveCell.Offset(3, 0).Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.AutoFilter
.Range("$A$4:$F$800").AutoFilter Field:=3, Criteria1:="0"
ActiveCell.Offset(6, 1).Range("A1").Select
lastRow = .Range("A" & Rows.Count).End(xlUp).Row
.Range(.Range("b2"), .Range("b" & lastRow)). _
SpecialCells(xlCellTypeVisible).Value = _
"0"
ActiveCell.FormulaR1C1 = "0"
.Range("$A$4:$F$800").AutoFilter Field:=3
.Range("a1").Select
.Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Set ImCrazy = .Find("Total", xlValues, xlPart, xlByRows, xlNext, False, False)
If Not ImCrazy Is Nothing Then
ImCrazy.Offset(0, 1).Value = "=SUM(R[-" & knt & "]C:R[-1]C)"
ImCrazy.Offset(0, 3).Value = "=(RC[-1]+RC[2])/RC[-2]"
Else
MsgBox "'Total' not found'"
End If
End With
End Sub
我还需要这是一个循环,所以它会继续检查单词“总“
总结 1.我需要关于运行时错误的帮助 2.我需要帮助构建代码来重复查找”total“并插入函数。
在此先感谢!