djl0525
Well-known Member
- Joined
- Dec 11, 2004
- Messages
- 1,238
This code below works great to unhide sheets in my workbook.
Instead of opening the VB Editor to comment out sheets I don't want to display, I'd like the code to look at one of my sheets to see which sheets to unhide.
Sheetnames - The sheets are listed in columns A on the "Trainer's Sheet 1" sheet. The sheet names listed are the actual tab names (not Sheet05, Sheet10, etc.)
Which sheets to display - Column B contains Yes or No. Yes for unhide. No for do not unhide.
I'd like help modifying the code to unhide sheets where it finds Yes in column B next to the respective sheetname.
Any assistance will be greatly appreciated!
DJ
Sub ShowExerciseSheets()
'This macro is run from the Welcome sheet
'It will unhide the Intro sheet, 6 exercise sheets and the blank sheet
'Comment out the sheets do not want to unhide
Application.ScreenUpdating = False
MsgBox ThisWorkbook.Sheets("MsgBoxes").Range("B2").Value, , "Training."
Sheet05.Visible = True 'unhide Introduction
Sheet10.Visible = True 'unhide 1st exercise sheet
Sheet20.Visible = True 'unhide 2nd exercise sheet
Sheet30.Visible = True 'unhide 3rd exercise sheet
Sheet40.Visible = True 'unhide 4th exercise sheet
Sheet50.Visible = True 'unhide 5th exercise sheet
Sheet60.Visible = True 'unhide 6th exercise sheet
Sheet99.Visible = True 'unhide blank sheet
'Activate the Introduction! Sheet
Worksheets("Introduction").Activate
Range("A1").Select
Application.ScreenUpdating = True
End Sub
Instead of opening the VB Editor to comment out sheets I don't want to display, I'd like the code to look at one of my sheets to see which sheets to unhide.
Sheetnames - The sheets are listed in columns A on the "Trainer's Sheet 1" sheet. The sheet names listed are the actual tab names (not Sheet05, Sheet10, etc.)
Which sheets to display - Column B contains Yes or No. Yes for unhide. No for do not unhide.
I'd like help modifying the code to unhide sheets where it finds Yes in column B next to the respective sheetname.
Any assistance will be greatly appreciated!
DJ