XL: Worksheet May Be Activated When Method Is AppliedID: Q106463
|
When you apply methods or change properties of a worksheet, the target worksheet may need to be activated before the macro can perform the requested action. If the worksheet is not already active, a brief flash will be noticeable on the screen when the sheet is activated.
To resolve the problem explained in this article, add the following
line to the beginning of your Visual Basic for Applications macro:
Application.ScreenUpdating = False
Some methods and properties that are applied to worksheets will cause
the worksheet to be briefly activated.
Sub Protect_Sheet1()
ActiveWorkbook.Sheets("Sheet1").Protect
End Sub
ActiveWorkbook.Sheets("Sheet1").Unprotect
ActiveWorkbook.Sheets("Sheet1").Visible = True
ActiveWorkbook.Sheets("Sheet1").Move
Additional query words: 5.00c
Keywords :
Version : 5.00 5.00c 7.00
Platform : WINDOWS
Issue type :
Last Reviewed: April 8, 1999