怎样通过VB实现多个EXCEL中特定行列的数据的提取。要所有表中66行-77行,A列到D列的内容

2024-11-08 00:42:56
推荐回答(1个)
回答1:

先建立一个表格的循环,统计总共有多少个表格。然后分别循环每个表,取66-77行
Dim a, b, c, d, e As Integer
e = 1
a = ThisWorkbook.Sheets.Count
For b = 1 To a
'循环所有表格
For c = 66 To 77
Sheet7.Cells(e, 1) = Sheets(b).Cells(c, 1)
Sheet7.Cells(e, 2) = Sheets(b).Cells(c, 5)
e = e + 1
'取第66-77行A列和D列的数据
Next
Next