Sub 汇总()
Dim strPath As String
Dim MySht As String
Dim MyWK As Workbook
strPath = ThisWorkbook.Path
For I = 2 To 2001
If Cells(2, I) = "" Then
Exit For
Else
Set MyWK = Workbooks.Open(strPath & "\" & Cells(2, I) & ".xlsx") ''请注意你的EXCEL档案存放的路径
ARR = Range("B2:B7") ''注意你要复制的资料范围
End If
MyWK.Close
Cells(3, I).Resize(6, 1) = ARR
Next
End Sub
1、分表是否有密码?
2、为什么要选中才提取,而不是一次性提取?
3、分表有几百个 ,那总表最多可能存在几百列?
4、分表和总表是否存在一个文件夹下,分表和总表工作薄内取哪个名称的工作表(例Sheet1)
在Excel中用powerquery做吧!