Application.RestoreSheetSelection メソッド (Project)

選択したシート ビューの行と列の保存情報を復元します。

構文

expression. RestoreSheetSelection

expressionApplicationオブジェクトを表す変数 。

戻り値

ブール型 (Boolean)

次の例では、 SaveSheetSelectionRestoreSheetSelection の動作方法を示します。

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

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。