SelectedSheets Method

Applies To

Window Object.

Description

Accessor. Returns a Sheets collection that represents all the selected sheets in the specified window.

Syntax

object.SelectedSheets

object

Required. The Window object.

Example

This example displays a message if Sheet1 is selected in BOOK1.XLS.


For Each sh In Workbooks("BOOK1.XLS").Windows(1).SelectedSheets
    If sh.Name = "Sheet1" Then
        MsgBox "Sheet1 is selected"
        Exit For
    End If
Next