我有这个公式=SUM(D4*(K4/100))
我想在M列开始应用,从M4开始一直到最后一行数据。我如何使用宏来实现这一目标?
答案 0 :(得分:2)
这应该适合你:
Option Explicit
Sub Every3rdRow()
Dim sht As Worksheet
Set sht = Worksheets("Sheet1")
Dim lastRow As Integer
With sht
lastRow = .Cells(.Rows.Count, "D").End(xlUp).Row
Dim r As Integer
For r = 4 To lastRow Step 3
.Cells(r, "M").Formula = "=sum(D" & r & "*(K" & r & "/100))"
Next
End With
End Sub