将每列的第7行复制到Excel中的列A1列

时间:2016-08-13 12:38:28

标签: excel copy

我有A1列大约有1000条记录我想只复制第7条记录(单元格A1,A7,A13..etc)到B1列(在同一张表格中),任何公式都可以帮助我解决这个问题 谢谢

2 个答案:

答案 0 :(得分:1)

You can use VBA to do it. That way you don't have formulas on cells that you don't want to copy.

Sub test()


LastRow = Range("A" & Rows.Count).End(xlUp).Row

For i = 1 To LastRow Step 6
    Range("B" & i).Value = Range("A" & i).Value
Next i

End Sub

It will copy row 1, 7, 13, 19 etc. to column B.

You need to open VBA editor by pressing ALT+F11 and [Insert] [module].
Then just copy paste the code and run it.

If you do want to use a formula you can use this formula in column B.
Paste the formula in B1 and fill down.

=IF(MOD(ROW(A1);6)=1;A1;"")

enter image description here

答案 1 :(得分:1)

Copy A1 into B1 and in B2, copied down to suit:

=OFFSET(A$1,6*MOD(ROW()-1,7),)