![]() |
Minimizing windows for 50+ opened books at one go
Hi guys,
I've opened Book1.xls (I'm in Sheet1's A1, say), and then I open another 50 or so other books from a single folder (at one go). What I'm after is a generic sub which can minimize all other windows (i.e. those from the 50+ other books except the ones for Book1.xls). I will trigger the sub from Book1.xls. Appreciate any insights. Thanks. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
Minimizing windows for 50+ opened books at one go
Max,
Private Sub CommandButton1_Click() Dim Wnd As Window 'Quick way to handle Personal.xls and other hidden windows On Error Resume Next For Each Wnd In Application.Windows If Wnd.Caption < ActiveWindow.Caption Then Wnd.WindowState = xlMinimized End If Next End Sub NickHK "Max" wrote in message ... Hi guys, I've opened Book1.xls (I'm in Sheet1's A1, say), and then I open another 50 or so other books from a single folder (at one go). What I'm after is a generic sub which can minimize all other windows (i.e. those from the 50+ other books except the ones for Book1.xls). I will trigger the sub from Book1.xls. Appreciate any insights. Thanks. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- |
Minimizing windows for 50+ opened books at one go
Many thanks, Nick !
Runs smooth, but a small tweak requested as the sub also minimizes my other windows (window2, 3, etc) opened in Book1.xls I need these other windows to remain as-is. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "NickHK" wrote in message ... Max, Private Sub CommandButton1_Click() Dim Wnd As Window 'Quick way to handle Personal.xls and other hidden windows On Error Resume Next For Each Wnd In Application.Windows If Wnd.Caption < ActiveWindow.Caption Then Wnd.WindowState = xlMinimized End If Next End Sub NickHK |
Minimizing windows for 50+ opened books at one go
Max,
Change If Wnd.Caption < ActiveWindow.Caption Then To If Wnd.Parent.Name < ThisWorkbook.Name Then NickHK "Max" wrote in message ... Many thanks, Nick ! Runs smooth, but a small tweak requested as the sub also minimizes my other windows (window2, 3, etc) opened in Book1.xls I need these other windows to remain as-is. -- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "NickHK" wrote in message ... Max, Private Sub CommandButton1_Click() Dim Wnd As Window 'Quick way to handle Personal.xls and other hidden windows On Error Resume Next For Each Wnd In Application.Windows If Wnd.Caption < ActiveWindow.Caption Then Wnd.WindowState = xlMinimized End If Next End Sub NickHK |
Minimizing windows for 50+ opened books at one go
Excellent, thanks !
-- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "NickHK" wrote in message ... Max, Change If Wnd.Caption < ActiveWindow.Caption Then To If Wnd.Parent.Name < ThisWorkbook.Name Then NickHK |
All times are GMT +1. The time now is 09:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com