選択されているシートを参照する(SelectedSheets プロパティ)
2016/01/12
SelectedSheets プロパティ
選択されているすべてのシートをあらわす Sheets コレクション を返します。値の取得のみ可能です。
【書式】
object.SelectedSheets
引数・戻り値
- object ・・・ 対象となる Window オブジェクトを指定します。
SelectedSheets プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 |
Sub Sample_SelectedSheets() '「Sheet1」「Sheet2」を選択 Worksheets(Array("Sheet1", "Sheet2")).Select '選択されているシートの数を表示 MsgBox ActiveWindow.SelectedSheets.Count End Sub |
実行結果
関連記事
-
-
印刷:余白を設定 TopMargin,BottomMargin,LeftMargin,RightMargin,HeaderMargin,FooterMargin
余白を設定する 余白を設定する単位は、pt(ポイント:約 0.03528 cm) …
-
-
スクロールバーの表示・非表示(DisplayHorizontalScrollBar,DisplayVerticalScrollBar)
スクロールバーの表示・非表示の設定 Windows オブジェクト の Displ …
-
-
ページ数に合わせて印刷(FitToPagesTall, FitToPagesWide)
PageSetup.FitToPagesTall プロパティ PageSetup …
-
-
白黒印刷(PageSetup.BlackAndWhite プロパティ)
PageSetup.BlackAndWhite プロパティ PageSetup. …
-
-
印刷位置を中央に設定(CenterHorizontally, CenterVertically)
PageSetup.CenterHorizontally プロパティ PageS …
-
-
0 を表示するかどうかを設定(DisplayZeros プロパティ)
DisplayZeros プロパティ DisplayZeros プロパティに、T …
-
-
ブックのコピーを保存(SaveCopyAs メソッド)
SaveCopyAs メソッド SaveCopyAs メソッド は、現在開いてい …
-
-
ブックを閉じる(Close メソッド)
ブックを閉じる(Close メソッド) Close メソッド で、ブックを閉じる …
-
-
印刷設定(フッターに画像を指定)LeftFooterPicture,CenterFooterPicture,RightFooterPicture
フッターに画像を表示するには LeftFooterPicture プロパティ、C …
-
-
WorksheetView オブジェクト
WorkSheetView オブジェクト 行列番号や枠線の表示・非表示の設定など …
