title: VBA type mismatch
body: <p>I am getting a type mismatch in my simple code, and I dont understand why. Can someone explain why I am getting this error? I am getting the error on the ActiveSheet line.</p>
  
  <pre><code>Sub testHidden()
  Dim i As Integer
  Dim totalRows As Long
  
  totalRows = ActiveSheet.UsedRange.Rows.Count
  
  ActiveSheet.Rows("1:totalRows").Hidden = False
  
  End Sub
  </code></pre>