你把要放入B5单元格的数据 放在A列,B列放入对应的文件名
使用以下代码
Sub B5()
i = 1
Do Until ThisWorkbook.ActiveSheet.Cells(i, 2) = ""
Set dx_workbook = Workbooks.Open(ThisWorkbook.ActiveSheet.Cells(i, 2))
dx_workbook.Sheets("sheet1").Range("B5") = ThisWorkbook.ActiveSheet.Cells(i, 1)
i = i + 1
dx_workbook.Close
Set dx_workbook = Nothing
Loop
End Sub