title: Unable to set the hidden property of the range class run time error '1003'
body: <p>I have code in this module:</p>
  
  <pre><code>Sub HideSalTable()
  
  User = Worksheets("log").Range("R1").Value
  If User = ThisWorkbook.Worksheets("SSSSSS").Range("za1").Value Then
  Columns("S:AA").EntireColumn.Hidden = True
  
  ElseIf User = ThisWorkbook.Worksheets("SSSSSS").Range("za3").Value Then
  Columns("S:AA").EntireColumn.Hidden = False
  
  ElseIf User = ThisWorkbook.Worksheets("SSSSSS").Range("za4").Value Then
  Columns("S:AA").EntireColumn.Hidden = False
  
  End If
  
  End Sub
  </code></pre>
  
  <p>I have a button to redirect me to ThisWorkbook.Worksheets("SSSSSS") with this code:</p>
  
  <pre><code>Private Sub Change_SSSSSS_Button_Click()
  
   Dim pass1 As String
    Dim pass2 As String
    pass1 = ThisWorkbook.Worksheets("SSSSSS").Range("za3").Value
     pass2 = ThisWorkbook.Worksheets("SSSSSS").Range("za4").Value
    Dim Inp
      Dim lTries As Long
  
  
  
      lTries = 1
      Do
          Inp = InputBoxDK("enter password", "Zmhnk")
          If Inp = "" Or Inp = vbCancel Then Exit Sub          '* Cancel button pressed or nothing entered
          If Inp = (pass1) Or Inp = (pass2) Then
              Exit Do
          End If
          lTries = lTries + 1
          If lTries &gt; 4 Then
              MsgBox "Error", vbInformation, "Zmhnk"
              Exit Sub
          Else
              If MsgBox("try again", vbYesNo, "error_Zmhnk") = vbNo Then Exit Sub
          End If
      Loop
  
   Application.ScreenUpdating = False
  
   Sheets("SSSSSS").Visible = True
   Sheets("SSSSSS").Activate
  
   Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>The problem is when the user presses the button with the 2nd code I face an error and I don't know why.</p>
  
  <p>The error:</p>
  
  <pre><code>Unable to set the hidden property of the range class run time error '1003'
  </code></pre>