Application.RestoreSheetSelection method (Project)

Stellt die gespeicherten Informationen zu Zeilen und Spalten einer ausgewählten Tabellenansicht wieder her.

Syntax

Ausdruck. RestoreSheetSelection

expression Eine Variable, die ein Application-Objekt darstellt.

Rückgabewert

Boolean

Beispiel

Das folgende Beispiel veranschaulicht die Funktionsweise von SaveSheetSelection und RestoreSheetSelection veranschaulicht.

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

Support und Feedback

Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.