Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 866 Bytes

Excel.Window.SelectedSheets.md

File metadata and controls

41 lines (27 loc) · 866 Bytes
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Window.SelectedSheets property (Excel)
vbaxl10.chm356108
vbaxl10.chm356108
Excel.Window.SelectedSheets
3be18be3-895b-131b-7416-270536b84e23
05/21/2019
medium

Window.SelectedSheets property (Excel)

Returns a Sheets collection that represents all the selected sheets in the specified window. Read-only.

Syntax

expression.SelectedSheets

expression A variable that represents a 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

[!includeSupport and feedback]