Hi,
Your problem as I understand it:
1) Find number of files named "book##".
2) Get the value of B2 in each of them
3) Put that value in C1...C# of new workbook (activesheet)
4) Have those values update automatically (an active link)
This Sub does exactly that. Change the "bookname" , "sheetname", etc as commented in the code if needed.
Sub b2()
Dim a As Long
Dim FileNames()
Dim FileCount As Long
Dim FileList As String
'Variable for file names: Change pathname as needed,
' change "book*.xls" to real "filename*.xls" here AND below
FileList = Dir("book*.xls")
'Gets count of filenames
FileCount = 0
Do Until FileList = ""
FileCount = FileCount + 1
FileList = Dir
Loop
'Assigns names to an array in memory
ReDim FileNames(0, FileCount)
' change "book*.xls" to real "filename*.xls" here as well
FileList = Dir("book*.xls")
For a = 1 To FileCount
FileNames(0, a) = FileList
FileList = Dir
Next
'Puts data in C1 to C#
For a = 1 To FileCount
'change "]Sheet1!$B$2" if needed. Note: 3 in Cells(a,3) = column 3
ActiveSheet.Cells(a, 3).Formula = "=[" & FileNames(0, a) & "]Sheet1!$B$2"
Next
End Sub
Try this and let me know if it works for you!
Cheers,
dr