前後のワークシートを参照する(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 |
実行結果
関連記事
-
-
印刷設定(フッターに画像を指定)LeftFooterPicture,CenterFooterPicture,RightFooterPicture
フッターに画像を表示するには LeftFooterPicture プロパティ、C …
-
-
ファイル保存の既定の形式を取得・設定(DefaultSaveFormat プロパティ)
DefaultSaveFormat プロパティ DefaultSaveForma …
-
-
ブックが共有モードか確認する(MultiUserEditing プロパティ)
ブックが共有モードか確認する(MultiUserEditing プロパティ) 共 …
-
-
指定された情報をブックから削除(RemoveDocumentInformation メソッド)
RemoveDocumentInformation メソッド 指定された種類の情 …
-
-
行列番号を含めて印刷(PageSetup.PrintHeadings プロパティ)
PageSetup.PrintHeadings プロパティ PageSetup. …
-
-
アクティブプリンタを変更(ActivePrinter プロパティ)
ActivePrinter プロパティ ActivePrinter プロパティを …
-
-
最近使用したファイル(RecentFile オブジェクト,RecentFiles コレクション)
最近使用したファイル(RecentFile オブジェクト,RecentFiles …
-
-
数式バーの設定(DisplayFormulaBar, FormulaBarHeight)
数式バーの設定 数式バーの表示・非表示の設定を行うには、DisplayFormu …
-
-
印刷時、シート内のエラーをどう扱うかを設定(PrintErrors プロパティ)
PageSetup.PrintErrors プロパティ PageSetup.Pr …
-
-
印刷の先頭のページ番号を設定(PageSetup.FirstPageNumber プロパティ)
PageSetup.FirstPageNumber プロパティ PageSetu …
