Hi,
i need to hide worksheets based on the content of a cell. I have a summary sheet (called "voorblad") the trigger for one sheet should be the contect of a cell in collumn Q (i.e. Q7) and the name of the sheet is one the same row in collumn C (i.e. C7).
this repeats every 3 rows.
I want to check if "Q7" is 0 then the sheet with name as in cell C7 should hide. Then repeat this for every third row after row 7. (row 10, 13, 16.....)
I have now this code:
Private Sub Worksheet_Change(ByVal Target As Range)
If [Q7] <> 0 Then
Sheets("7").Visible = True
Else
Sheets("7").Visible = False
End If
End Sub
This works but now I need to repeat it and get the sheets("7") replace by the name as in cell B7.
Any help is very welcome.
rgds,
mark
i need to hide worksheets based on the content of a cell. I have a summary sheet (called "voorblad") the trigger for one sheet should be the contect of a cell in collumn Q (i.e. Q7) and the name of the sheet is one the same row in collumn C (i.e. C7).
this repeats every 3 rows.
I want to check if "Q7" is 0 then the sheet with name as in cell C7 should hide. Then repeat this for every third row after row 7. (row 10, 13, 16.....)
I have now this code:
Private Sub Worksheet_Change(ByVal Target As Range)
If [Q7] <> 0 Then
Sheets("7").Visible = True
Else
Sheets("7").Visible = False
End If
End Sub
This works but now I need to repeat it and get the sheets("7") replace by the name as in cell B7.
Any help is very welcome.
rgds,
mark