I’m pretty new to vba and am have a workbook with 40 tabs that have a lot of calculations. I created a couple of summary sheet for the 40 tabs but it takes a while to calc. I tried to use the code below in the individual worksheets that I want to hide, but got an error.
Private Sub Calc() 'Turns calculation off if hidden
If Worksheets("Sheet61").Visible = False Then
EnableCalculation = False
End If
End Sub
It highlighted the If statement. I’d also like to confirm I’m putting it in the correct place which is the code of the individual worksheets. Lastly, I want to make sure the EnableCalculation would be off if the file is opened and the sheets are hidden. I think it may have to recalc once when it’s opened and that’s OK.
I’m in Windows 10 and Office Pro 2016
Any help is greatly appreciated and thanks in advance.
Cheers!
Private Sub Calc() 'Turns calculation off if hidden
If Worksheets("Sheet61").Visible = False Then
EnableCalculation = False
End If
End Sub
It highlighted the If statement. I’d also like to confirm I’m putting it in the correct place which is the code of the individual worksheets. Lastly, I want to make sure the EnableCalculation would be off if the file is opened and the sheets are hidden. I think it may have to recalc once when it’s opened and that’s OK.
I’m in Windows 10 and Office Pro 2016
Any help is greatly appreciated and thanks in advance.
Cheers!