Watersource
New Member
- Joined
- Jan 3, 2009
- Messages
- 17
- Office Version
- 365
- 2016
- Platform
- Windows
Hello,
I have created a VBA macro that first cleans the content of the sheets and then fills the sheet with new data again. As quite a lot of data is gathered, I have tried to show that cleaning the content has finished (by putting .ScreenUpdating to True and False again) but this does not work yet. No updating takes place during running of this macro, only when it is finished. Could you give me some pointers how to achieve this.
Thanks for your help on this.
I have created a VBA macro that first cleans the content of the sheets and then fills the sheet with new data again. As quite a lot of data is gathered, I have tried to show that cleaning the content has finished (by putting .ScreenUpdating to True and False again) but this does not work yet. No updating takes place during running of this macro, only when it is finished. Could you give me some pointers how to achieve this.
VBA Code:
Sub Refresh_Data()
Dim sht As Worksheet
Dim shtActiveSht As Worksheet
Set shtActiveSht = ActiveSheet
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
On Error Resume Next
ClearSheets --sub to clear contents
.ScreenUpdating = True
.ScreenUpdating = False
On Error GoTo 0
.Run ("EG2000.XLA!ThisWorkbook.AddIn_OnRefresh")
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
MsgBox ("The reports have been updated.")
End With
End Sub
Thanks for your help on this.
Last edited: