Skip to content

Latest commit

 

History

History
69 lines (46 loc) · 1.71 KB

Project.Application.RestoreSheetSelection.md

File metadata and controls

69 lines (46 loc) · 1.71 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.RestoreSheetSelection method (Project)
vbapj.chm2096
vbapj.chm2096
project-server
Project.Application.RestoreSheetSelection
cbc4dd00-4055-b505-661b-e2c0276335b3
06/08/2017
medium

Application.RestoreSheetSelection method (Project)

Restores saved row and column information of a selected sheet view.

Syntax

expression. RestoreSheetSelection

expression A variable that represents an Application object.

Return value

Boolean

Example

The following example demonstrates how SaveSheetSelection and RestoreSheetSelection work.

Sub SelectionDemo() 
 
 '1) In your sheet view, make column/row/cell selections, then run this 
 '2) macro which toggles the Project Guide display state, and 
 ' clears the ActiveSelection (saved via Application.SaveSheetSelection). 
 '3) The macro then restores the ActiveSelection via Application.RestoreSheetSelection 
 
 'Save the ActiveSelection in the active sheet view 
 Application.SaveSheetSelection 
 
 'Toggle the Project Guide display state 
 Dim boolPGON As Boolean 
 boolPGON = Application.DisplayProjectGuide 
 
 If boolPGON = True Then 
 Application.DisplayProjectGuide = False 
 Else 
 Application.DisplayProjectGuide = True 
 End If 
 
 MsgBox "The Project Guide display state has been toggled. " _ 
 & "Notice that your active selection was cleared in the " _ 
 & "process." & Chr(10) & Chr(10) _ 
 & "Now the call to RestoreSheetSelection restores the ActiveSelection...", _ 
 vbOKOnly 
 
 Application.RestoreSheetSelection 
 
End Sub

[!includeSupport and feedback]