- 帖子
- 354
- 主題
- 5
- 精華
- 0
- 積分
- 387
- 點名
- 0
- 作業系統
- windows7
- 軟體版本
- vba,vb,excel2007
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2017-1-8
- 最後登錄
- 2024-8-2
 
|
2#
發表於 2023-12-4 01:40
| 只看該作者
本帖最後由 singo1232001 於 2023-12-4 01:41 編輯
回復 1# av8d
Sub 巨集1()
Left1 = 0
Top1 = 0
width1 = 575 ' (請自行調整寬度)
height1 = 617 ' (請自行調整高度)
For Each Z In Windows
If Z.Caption Like "活頁簿1.xlsm" Then
If Z.WindowState <> xlNormal Then Z.WindowState = xlNormal
If Z.WindowState <> xlNormal Then Z.WindowState = xlNormal
Z.Left = Left1
Z.Top = Top1
Z.Width = width1
Z.Height = height1
ElseIf Z.Caption Like "活頁簿2.xlsm" Then
If Z.WindowState <> xlNormal Then Z.WindowState = xlNormal
If Z.WindowState <> xlNormal Then Z.WindowState = xlNormal
Z.Left = Left1 + width1
Z.Top = Top1
Z.Width = width1
Z.Height = height1
End If
Next
End Sub |
|