|
▼Jママ さん:
こんばんは。
以下のようなサブプロシジャーを使うと、
sub test()
call winArrange(workbooks("b.xlsm"), workbooks("c.xlsm"))
end sub
Sub winArrange(ByVal kbook1 As Workbook, ByVal kbook2 As Workbook, Optional ByVal stl As XlArrangeStyle = xlArrangeStyleHorizontal)
Dim x As Window
Application.ScreenUpdating = False
On Error Resume Next
For Each x In Windows
x.WindowState = xlMinimized
Next x
With kbook2.Windows(1)
.WindowState = xlNormal
.Top = 1
.Left = 1
.Height = Application.UsableHeight
.Width = Application.UsableWidth
End With
With kbook1.Windows(1)
.WindowState = xlNormal
.Top = 1
.Left = 1
.Height = Application.UsableHeight
.Width = Application.UsableWidth
End With
Windows.Arrange arrangestyle:=stl
kbook1.Activate
On Error GoTo 0
Application.ScreenUpdating = True
End Sub
|
|