在不同的列VBAmacros中每隔三行应用公式

我有这个公式=SUM(D4*(K4/100))我想在M列开始,一直到最后一行使用的数据。 我将如何使用macros实现这一点?

这应该为你做到这一点:

 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