Hello.. can someone please help me debug this supposedly simple code.. I am getting error Method Range of Object Worksheet failing
I am trying to hide those sheets where Range ("DCT_Status").Value = "Complete"
Each sheet has a range named "DCT_Status" which is mapped to the sheet.
I am trying to hide those sheets where Range ("DCT_Status").Value = "Complete"
Each sheet has a range named "DCT_Status" which is mapped to the sheet.
VBA Code:
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible And ws.Range("DCT_Status").Value = "Complete" Then
ws.Visible = xlSheetHidden
End If
Next ws