Excel如何取出第10行、20行、30行、40行……的数据

2024-11-09 09:24:08
推荐回答(4个)
回答1:

Public Sub 提取()
Dim lr1%, lr2%, lc%, i%, j%
lr1 = Sheet1.Cells(65536, 1).End(xlUp).Row

For i = 1 To lr1
lc = Sheet1.Cells(i, 1000).End(xlToLeft).Column
lr2 = Sheet2.Cells(65536, 1).End(xlUp).Row
For j = 1 To lc
If i Mod 10 = 0 Then
Sheet2.Cells(lr2 + 1, j) = Sheet1.Cells(i, j)
End If
Next
Next
End Sub

回答2:

添加一行辅助列,使满足条件的结果为0,然后数据透视,就能得出明细了

回答3:

=INDEX(Sheet1!A:A,ROW(A1)*10)
右拉下拉

回答4:

=OFFSET($A$1,ROW(A1)*10-1,COLUMN(A1)-1)