If you are working on multiple workbooks at the same time, and you need a macro to help you in hiding all the inactive workbooks, then this article will definitely help you.
In this article, we will focus on how we can hide multiple workbooks which you are currently not being used.
Question: I need to quickly hide all the excel files except the one I am currently using so that I can toggle between other applications smoothly. I would like to seek VBA code for this unique requirement of mine.
In order to get the code for hiding all the inactive workbooks, we need to follow the below steps to launch VB editor
Sub HideInactiveExcelWorkbooks() Application.ScreenUpdating = False Dim aWin As Window Set aWin = ActiveWindow Dim win As Window For Each win In Application.Windows win.Visible = False Next win aWin.Visible = True Application.ScreenUpdating = True End Sub
Note: the above macro will not hide active workbook.
To unhide all the workbooks, we need to follow the below steps:
Conclusion: We can hide hundreds of workbooks which are not active with a single click using above macro code.
If you liked our blogs, share it with your friends on Facebook. And also you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve, complement or innovate our work and make it better for you. Write us at firstname.lastname@example.org
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.