Sub ウィンドウの上下整列() Windows.Arrange ArrangeStyle:=xlArrangeStyleHorizontal 'xlArrangeStyleVertical にすると横に並べて整列 End Sub Sub 同一Sheetの複数画面表示() Dim sBookName As String Dim nLen As Integer sBookName = ActiveWindow.Caption nLen = Len(sBookName) ActiveWindow.NewWindow If Mid(sBookName, nLen - 1, 1) <> ":" Then Windows(sBookName & ":1").Activate End If Windows.Arrange ArrangeStyle:=xlHorizontal End Sub Sub To_Home() Dim ws As Variant For Each ws In Worksheets If Sheets(ws.Name).Visible = True Then Sheets(ws.Name).Select Range("A1").Select End If Next Sheets(1).Select End Sub Sub セル移動方向切替() If Application.MoveAfterReturn = False Then Application.MoveAfterReturn = True Application.MoveAfterReturnDirection = xlDown Exit Sub End If If Application.MoveAfterReturnDirection = xlDown Then Application.MoveAfterReturnDirection = xlToRight Else Application.MoveAfterReturnDirection = xlDown End If End Sub Sub 枠線表示切替え() ActiveWindow.DisplayGridlines = Not (ActiveWindow.DisplayGridlines) End Sub Sub 行列番号表示切替() ActiveWindow.DisplayHeadings = Not (ActiveWindow.DisplayHeadings) End Sub Sub 全シート表示() Dim ws As Variant For Each ws In Sheets Sheets(ws.Name).Visible = True Next Sheets(1).Select End Sub Sub シート隠蔽() Dim ws As Variant Dim response As Integer Dim i As Integer Dim cnt As Integer cnt = 0 For Each ws In Sheets If Sheets(ws.Name).Visible = True Then '表示されているシートの数 cnt = cnt + 1 End If Next i = 0 For Each ws In Sheets If Sheets(ws.Name).Visible = True Then Sheets(ws.Name).Select i = i + 1 response = MsgBox("シート(" & i & ") 【 " & ws.Name & " 】 を隠しますか?" & Chr$(13) & Chr$(13), _ vbYesNoCancel + vbQuestion + vbDefaultButton2, "確認!") If response = vbYes Then If cnt = 1 Then MsgBox "全てのシートを非表示にする事は出来ません!", vbExclamation Exit Sub End If Sheets(ws.Name).Visible = False cnt = cnt - 1 Else If response = vbCancel Then Exit Sub End If End If End If Next End Sub Sub A1_R1C1() If Application.ReferenceStyle = xlR1C1 Then Application.ReferenceStyle = xlA1 Else Application.ReferenceStyle = xlR1C1 End If End Sub Sub Auto_Header() With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "" .RightHeader = "&10&F &A &D &T &P / &N" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" End With ActiveSheet.PrintPreview End Sub