Learn and Create Macros easily - Hide and Unhide sheets
Welcome to the blog. Here we will learn and Hide and Unhide the Sheets using VBA Code in a very easy way. In this blog we will learn how to hide and unhide multiple sheets at one go using the VBA Code. We will be using the excel file used in last blog where we created multiple TABs. We will try to learn to hide these sheets and unhide these sheets. The Code will look Like this You can copy the code from below and use it in your excel. Below code is to Hide the sheets ----------------- Sub Hide_Sheets() Tot_Sheet = ActiveWorkbook.Sheets.Count For i = 2 To Tot_Sheet Sheets(i).Visible = xlSheetHidden Next i End Sub ---------- Below code is to UnHide the sheets --------- Sub Unhide_Sheets() For Each Worksheet In ActiveWorkbook.Worksheets Worksheet.Visible = xlSheetVisible Next Worksheet End Sub --------- Now let us learn how to write the code with explanation Not...

Comments
Post a Comment