ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Refresh - Help! (https://www.excelbanter.com/excel-worksheet-functions/131901-refresh-help.html)

opal

Refresh - Help!
 
I have read many posts on this site that deals with auto refreshing data in
spreadsheets but none that answer my question or have worked for me. I have a
workbook with many worksheets that I would like to refresh or recalculate all
with a macro. One sheet brings in data from a database on the hour and
calculates it and then it is dispersed in the various spreadsheets with
further calculations. I have used the following but get a subscript out of
range error which makes me believe I have to loop through all the worksheets
to refresh. I am not sure how to do this.

Sub mcrRefresh()

Application.DisplayAlerts = False
Sheets("Sheet1").Select
Range("A1").Select
ActiveWorkbook.RefreshAll
Application.DisplayAlerts = True
MsgBox("Refresh Complete")
End Sub

I thought maybe just using the F9 button would also work but it doesnt. I
have the options set to automatically refresh but that doesn't work either.
The Ctrl + Alt + F9 button works but recalculates everything which can take a
long time.
Thanks for any help!



All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com