Hello,
Using the code from the link in my comment ( +1 there to @mauricio ) produced the following:
Option Explicit
Sub sheets
Dim oDoc As Object
Dim oHomeSheet As Object
Dim oSheetResult As Object
Dim oCellD As Object
Dim oCellB As Object
Dim sSheetView As String
Dim sSheetName As String
Dim iRow As Integer
Dim v
oDoc = ThisComponent
For iRow = 5 to 34
oHomeSheet = oDoc.Sheets.getByName("Index")
oCellD = oHomeSheet.getCellByPosition(3, iRow)
oCellB = oHomeSheet.getCellByPosition(1, iRow)
sSheetView = LCase(oCellD.String)
If sSheetView = "yes" Then
v = False
ElseIf sSheetView = "no" then
v = True
Else
Exit Sub
End If
oSheetResult = oDoc.Sheets.getByName(oCellB.String)
oSheetResult.isVisible = v
Next
End Sub
Sub ShowAll
Dim oDoc As Object
Dim iCount As Integer
Dim x As Integer
oDoc = ThisComponent.Sheets
iCount = oDoc.Count
For x = 0 to iCount -1
oDoc.getByIndex(x).isVisible = True
Next
End Sub
The sub sheets
hides/reveals base upon your Column D - rows 6 to 35. If an entry is not ‘yes’ or ‘no’ the process stops.
The sub ShowAll
reveals all sheets.