excel汇总表如何自动获取同一文件夹下不同工作簿中(工作表内容完全相同)的相同数据

在同一文件夹中,存放上百个人信息采集表,在一新工作簿中生成这些信息汇总,每人一行。急急

只能用VBA来完成,提高悬赏分,在下面补全代码即可!

Private Sub CommandButton1_Click()
    Dim strA As String, wb As Workbook, i As Long, n As Long
    strA = Dir(ThisWorkbook.Path & "\*.xls")
    
    Do While strA <> ""
        For Each wb In Workbooks
            If wb.Name = strA Then GoTo wbnext
        Next
        Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & strA)
wbnext:
               
           '处理数据
           ???
           '处理数据完成

strADo:
        wb.Close True
        strA = Dir
    Loop
    
End Sub

温馨提示:答案为网友推荐,仅供参考
相似回答