试试这个
Option Explicit
Sub Demo()
Dim srcSht As Worksheet, destSht As Worksheet
Dim rowIndex As Long, colIndex As Long
Set srcSht = ThisWorkbook.Sheets("Sheet1") 'change Sheet1 to your source sheet
Set destSht = ThisWorkbook.Sheets("Sheet2") 'change Sheet1 to your output sheet
rowIndex = 1
colIndex = 28 'set col number for Column AB
With srcSht
Do While .Cells(8, colIndex).Value <> "" 'loop through column AB to last column with data in row 8
destSht.Cells(rowIndex, 1) = .Cells(8, colIndex)/.Cells(9, colIndex)
rowIndex = rowIndex + 5 'increment row by 5
colIndex = colIndex + 1 'increment column by 1
Loop
End With
End Sub
所以,你可以* *拖动公式,是吗?你只是想计算'AB8/AB9',然后'AB9/AB10','AB10/AB11'等?但从表2开始,列A,然后是F,然后是K等? – BruceWayne
我想从表1中复制公式AB8/AB9并将其插入到工作表2中的每第5列中并添加+1列,以便工作表2中的A1看起来像AB8/AB9,并且A5将是AC8/AC9而不是AG8/AG9作为栏A1-A5填写sheet2中的另一个数据 – Zenik