前後のワークシートを参照する(Previous プロパティ,Next プロパティ)
Previous プロパティ
指定したシートの前(左側)のシートを参照します。
【書式】
object.Previous
項目の説明
- object ・・・ 対象となる Worksheet オブジェクトを指定します。
Next プロパティ
指定したシートの後(右側)のシートを参照します。
【書式】
object.Next
項目の説明
- object ・・・ 対象となる Worksheet オブジェクトを指定します。
Previous プロパティ・Next プロパティ 使用例
サンプルVBAソース
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Sub Sample_PreviousNext() Dim str As String Application.Worksheets(2).Activate str = ActiveSheet.Previous.Name & Chr(13) str = str & ActiveSheet.Next.Name MsgBox str End Sub |
実行結果
関連記事
-
-
背景に画像を表示(SetBackgroundPicture メソッド)
SetBackgroundPicture メソッド SetBackgroundP …
-
-
指定された情報をブックから削除(RemoveDocumentInformation メソッド)
RemoveDocumentInformation メソッド 指定された種類の情 …
-
-
ユーザー設定のビュー(CustomView オブジェクト)
ユーザー設定のビュー CustomView オブジェクトは、登録されている各ビュ …
-
-
ウィンドウのタイトル(Window.Caption プロパティ)
ウィンドウのタイトル(Caption プロパティ) Windows.Captio …
-
-
並べて比較(CompareSideBySideWith,SyncScrollingSideBySide,BreakSideBySide)
並べて比較(CompareSideBySideWith メソッド) Compar …
-
-
イベントの発生・無効をコントロール(EnableEvents プロパティ)
EnableEvents プロパティ EnableEvents プロパティに T …
-
-
ウィンドウの位置を入れ替える(ActivatePrevious メソッド、ActivateNext メソッド)
ウィンドウの位置を入れ替える ActivatePrevious メソッド、Act …
-
-
シートが保護されているか確認(ProtectContents プロパティ)
ProtectContents プロパティ ワークシートが保護されているかどうか …
-
-
WorksheetView オブジェクト
WorkSheetView オブジェクト 行列番号や枠線の表示・非表示の設定など …
-
-
ユーザー設定のドキュメントプロパティ(CustomDocumentProperties プロパティ)
CustomDocumentProperties プロパティ ユーザー設定のドキ …
