![]() ![]() ![]() In the following example, we’ll disable a shortcut menu item “ Cut” (which was added to the Cells menu) when the Sheet1 is activated: Private Sub Worksheet_Activate()ĬommandBars("Cell").Controls("Cut").Enabled = False For example, when you right-click on a ribbon, a different menu appears, but when you right-click on a cell, a completely different menu appears. This menu varies at different Excel parts. The second example demonstrates how to automatically refresh all pivot tables whenever the particular worksheet is activated: Private Sub Worksheet_Activate()įor i = 1 To ĪctiveSheet.PivotTables(i).PivotCache.RefreshĮxcel shows you a shortcut menu when you right-click. This code simply pops up a message box that displays Welcome Back message: Private Sub Worksheet_Activate() Following is a very simple example that is executed whenever a particular worksheet is activated.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |