Automatic Function Result Update when using A VLOOKUP on another F
The only way you will get file B to contain up to date data is to open
it. You could have file A open and close file B on startup.
Sub RefreshFromFileB()
Dim WS As Worksheet
Dim QT As QueryTable
Application.ScreenUpdating = False
Workbooks.Open ThisWorkbook.Path &"\FileB.xls"
For Each WS In ActiveWorkbook.Worksheets
For Each QT In WS.QueryTables
QT.Refresh BackgroundQuery:=False
Next
Next
ActiveWorkbook.Save
ActiveWorkbook.Close False
Application.ScreenUpdating = True
End Sub
Sub Auto_Open()
' update from FileB when I've finished opening.
Application.OnTime Now,"RefreshFromFileB"
End Sub
Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup
|