Does this work in place of your For/Next loop

For Each ws In ActiveWorkbook.Worksheets
    If Not (ws.Name = "Inputs" Or ws.Name = "SummaryOutput" Or ws.Name = "DetailedOutput") Then
       ws.Visible = xlSheetHidden

    End If
Next ws