我试图在“总服务费”单元格上方获得 G:26 到 1 列的总和。我遇到了运行时错误“1004”。应用程序定义或对象定义的错误。有谁知道这可能来自什么?
Worksheets(1).Select
Dim rng1 As Range
Dim strSearch As String
strSearch = "Total Service Fees"
Set rng1 = Range("F15:F100").Find(strSearch, , xlValues, xlWhole)
If Not rng1 Is Nothing Then
rng1.Offset(0, 1).Select
ActiveCell.Formula = "=SUM(G26:" & ActiveCell.Offset(-1, 0).Select & ")"
Else
MsgBox strSearch & " not found"
End If
我得到了正确的答案,但我仍然得到这个错误。