ウィンドウの位置を入れ替える(ActivatePrevious メソッド、ActivateNext メソッド)
2016/01/12
ウィンドウの位置を入れ替える
ActivatePrevious メソッド、ActivateNext メソッドを使用すると現在のウィンドウ位置を変更することが可能です。
ActivatePrevious メソッド
まず、指定したウィンドウをアクテイブにし、次にその時一番後ろにウィンドウをアクティブにします。
object.ActivatePrevious
引数・戻り値
- object ・・・ 対象となる Window オブジェクトを指定します。
ActivateNext メソッド
まず、指定したウィンドウをアクテイブにし、次にそのウィンドウを一番後ろに移動します。
object.ActivateNext
引数・戻り値
- object ・・・ 対象となる Window オブジェクトを指定します。
ActivatePrevious メソッド・ActivateNext メソッド 使用例
サンプルVBAソース 1
|
1 2 3 4 5 6 7 8 9 |
Sub Sample_ActivatePrevious() 'まず「2番目のウィンドウ」をアクテイブにし、 '次に「一番後ろのウィンドウ」をアクティブにする Windows(2).ActivatePrevious End Sub |
サンプルVBAソース 1 実行結果
実行前 (「Book1」「Book2」「Book3」)
実行後(「Book3」「Book2」「Book1」)
サンプルVBAソース 2
|
1 2 3 4 5 6 7 8 |
Sub Sample_ActivateNext() 'アクティブウィンドウを一番後ろにする ActiveWindow.ActivateNext End Sub |
サンプルVBAソース 2 実行結果
実行前 (「Book2」「Book1」「Book3」)
実行後(「Book1」「Book3」「Book2」)
関連記事
-
-
印刷のタイトル行、タイトル列を設定(PrintTitleRows,PrintTitleColumns)
PageSetup.PrintTitleRows プロパティ PageSetup …
-
-
セルのコメントを印刷(PageSetup.PrintComments プロパティ)
PageSetup.PrintComments プロパティ PageSetup. …
-
-
印刷設定を高速化(PrintCommunication プロパティ)
PrintCommunication プロパティ PrintCommunicat …
-
-
ウィンドウを拡大・縮小(Zoom プロパティ)
ウィンドウを拡大・縮小(Zoom プロパティ) ウィンドウの表示サイズをパーセン …
-
-
ブックが互換モードで開いているか確認する(Excel8CompatibilityMode プロパティ)
ブックが互換モードで開いているか確認する Excel8Compatibility …
-
-
印刷設定(フッターに文字列を指定)LeftFooter,CenterFooter,RightFooter
PageSetup.LeftFooter プロパティ PageSetup.Lef …
-
-
ファイル保存の既定の形式を取得・設定(DefaultSaveFormat プロパティ)
DefaultSaveFormat プロパティ DefaultSaveForma …
-
-
ウィンドウ枠の固定(FreezePanes プロパティ、SplitColumn プロパティ,SplitRow プロパティ)
ウィンドウ枠の固定と解除 ウィンドウ枠を固定するには FreezePanes プ …
-
-
ウィンドウの分割(Split プロパティ,SplitColumn プロパティ,SplitRow プロパティ)
ウィンドウの分割と解除 ウィンドウ(ワークシート画面)を分割するには、Split …
-
-
ワークブックを保護・保護を解除(Protect メソッド・Unprotect メソッド)
Protect メソッド・Unprotect メソッド Protect メソッド …



