错误:应用程序定义或对象定义1004-VBA

时间:2019-09-26 14:22:50

标签: excel vba

Dim i, y As Integer
Dim str, str1 As String

y = ThisWorkbook.Worksheets("WaterFall").Cells(Rows.Count, 1).End(xlUp).Row

For i = 5 To y Step 1
    str1 = "I" & CStr(i)
    str = "=IF(I4<>'""',AL" & CStr(i) & "-AK" & CStr(i) & ",0)"
    ThisWorkbook.Worksheets("WaterFall").Range(str1).Formula = str
Next

我尝试了所有操作,但是抛出了错误。有什么想法吗?

0 个答案:

没有答案