LoginSignup
5
6

More than 5 years have passed since last update.

今開いてる Excel ファイルを別ウィンドウで開き直すマクロ

Posted at

Excel2010 は複数ファイルを開くと、一つのウィンドウ内に複数のファイルを開く。
2つの表を見比べるときに、時折鬱陶しい。

Sub openWithNewWindow()
    Dim filePath As String
    Dim wshShell
    filePath = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
    ActiveWorkbook.Close
    Set wshShell = CreateObject("WScript.Shell")
    wshShell.Run ("""" & Application.Path & "\excel.exe"" """ & filePath & """")
End Sub
  1. マクロに登録
  2. %appdata%\Microsoft\Excel\XLSTARThoge.xlsm で保存
  3. Excelファイルを開くと自動的に hoge.xlsm が非表示で立ち上がる
  4. マクロから CTRL-q にでも登録
  5. 別ウィンドウで開きたい Excel で Ctrl-q すると、別ウィンドウで開く
  6. 幸せ

今は Ctrl-q する度に hoge.xlsm が表示状態で開くのが悩みです。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6