By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

expertatexcel.com

 


Sheets(2).visible = True

This VBA/Macro statement will make the second sheet visible if it currently is hidden.

Sheets in a workbook can be hidden from the user's view. Some reasons to hide a sheet are:
  • To reduce complexity by Presenting fewer sheets to a user
  • It has information you don't want them to easily change
  • You've implemented a feature where they filter a list of sheets and only the one's shown are visible

    Sheets is a collection object in VBA that contains all the sheets of a workbook.

    The #2 says to reference the second sheet.

    Visible is a sheet property that indicates and shows a sheet if True and hides it if set to false.

    Note that the sheet must be selected to make it the activesheet.

    You need to make a sheet visible before you select it or VBA will give you an error.

  •