New (and exasperated) VBA user here. I have browsed the forum trying to cannibalize VBA code to achieve my goal, but I think I will finally have to admit defeat.
I am trying to hide subsequent named sheets based on the true/false status on sheet 1 for various products (for example, cell D9 with a "FALSE" status would hide from sheet "ZAPEX ZW KK ZWN" to sheet "ZAPEX ZW KK ZWS_ZBR_ZWB_ZWBT MP",) but to be quite frank, I am struggling to get it to hide even just 1 sheet. The code I originally tried was as follows:
Private Sub HideSheets() Dim rngSheets As Range, rngSht As Range With ThisWorkbook.Worksheets("Sheet1") Set rngSheets = .Range("D9", .Range("D9").End(xlDown)) End With For Each rngSht In rngSheets.Cells ThisWorkbook.Worksheets(rngSht.Value).Visible = (rngSht.Offset(0, 1).Value = "TRUE") Next End Sub
Now I admit I know I have done something wrong (as it doesn't work), but for the life of me I am not sure what it is!
Could someone please just provide me with some pointers so I can start pushing ahead?
Many thanks in advance for any guidance!