title: VBA macro for hiding rows based on cell value
body: <p>I am working on a sheet that has sections which hides/shows a number of rows based on a cell value (between 1-10).  At the moment, I have a handful of nested if statements.  This has made my workbook painfully slow.  Is there a way to shrink this code? Thanks.</p>
  
  <pre><code>If Range("B87").Value = 10 Then
          Rows("88:98").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 9 Then
          Rows("98").EntireRow.Hidden = True
          Rows("88:97").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 8 Then
          Rows("97:98").EntireRow.Hidden = True
          Rows("88:96").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 7 Then
          Rows("96:98").EntireRow.Hidden = True
          Rows("88:95").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 6 Then
          Rows("95:98").EntireRow.Hidden = True
          Rows("88:94").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 5 Then
          Rows("94:98").EntireRow.Hidden = True
          Rows("88:93").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 4 Then
          Rows("93:98").EntireRow.Hidden = True
          Rows("88:92").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 3 Then
          Rows("92:98").EntireRow.Hidden = True
          Rows("88:91").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 2 Then
          Rows("91:98").EntireRow.Hidden = True
          Rows("88:90").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 1 Then
          Rows("90:98").EntireRow.Hidden = True
          Rows("88:89").EntireRow.Hidden = False
      Else
      If Range("B87").Value = 0 Then
          Rows("88:98").EntireRow.Hidden = True
      End If
      End If
      End If
      End If
      End If
      End If
      End If
      End If
      End If
      End If
      End If
  </code></pre>