|
本帖最后由 530534614 于 2018-9-1 08:16 编辑
这段代码运行时提示“应用程序定义或对象定义错误1004”,可否帮我看看,谢谢各位大神
Sub zongtouzi()
Dim hs_gcf, hs_qtf, i, j, k, l As Variant
Sheets("工程费用估算").Select
hs_gcf = Application.WorksheetFunction.CountIf(Range("F4:F30"), ">0") '工程费用的行数
Sheets("总投资估算表-概算法").Select
For i = 1 To hs_gcf
For j = 1 To 5
Cells(4 + i, j).FormulaR1C1 = "=工程费用估算!R[-1]C"
Next j
Next i
Sheets("总投资估算表-概算法").Select
For k = 3 To 30
If Sheets("其他费用").Cells(k, 3) > 0 Then
Cells(k + hs_gcf + 5, 3) = "=Sheets(""其他费用"").Cells(" & Trim(k) & ", 3)"
End If
Next
End Sub
|
|