r am new to vba and mostly research and copy code to try and understand but am currently stuck!
I have the following code which hides a worksheet based on a cell value - it works for row 3 in the worksheet
Code
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Range("D3").Value = "yes" Then
Worksheets(Range("c3").Value).Visible = True
Else
Worksheets(Range("c3").Value).Visible = False
Exit Sub
End If
Application.ScreenUpdating = True
End Sub
Display More
I now need it to do the same for row 4 through to row 50 obviously changing the cell reference accordingly.
I have tried some of the loop codes but with no success - i could just manually type it in for each row but that seems to be a long and ugly solution.
Column 3 contains the sheet name based on a vlookup formula to ascertain who the owner of the worksheet is
Column 4 contains a "yes" or "False" based on the owners name typed into cell F2
Grateful for any help thanks