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
我尝试了所有操作,但是抛出了错误。有什么想法吗?