title: Why is my If [Range] Is Nothing statement not detecting that the variable is Nothing?
body: <p>I have an If statement testing to see if Range CCAddedGPSum Is Nothing, which is the case, but when it tests, it determines it to be otherwise. </p>
  
  <p>When I use a <code>Debug.Print CCAddedGPSum.Value</code>, I receive an error claiming that an Object is required, which indicates the variable has not been <code>Set</code>. Why is this not returning as <code>Is Nothing</code>?</p>
  
  <p>Here is the code: </p>
  
  <pre><code>If CCAddedGPSum Is Nothing Then 'Once here, ignores the test and continues to "END IF"
      Set CCAddedGPSum = Range(CCGPSum.Offset(1, -3), CCGPSum.Offset(1, 1))
      CCAddedGPSum.Insert shift:=xlDown
  
      Set CCAddedGPSum = Range(CCGPSum.Offset(1, -3), CCGPSum.Offset(1, 1))
      CCAddedGPSum.Interior.ColorIndex = 0
      CCAddedGPSum.Insert shift:=xlDown
  
      Set CCAddedGPSum = Range(CCGPSum.Offset(1, -3), CCGPSum.Offset(1, 1))
      CCAddedGPSum.Interior.ColorIndex = 0
  
      Set CCAddedGPTitle = Range(CCGPSum.Offset(1, -2), CCGPSum.Offset(1, -1))
      With CCAddedGPTitle
          .MergeCells = True
          .HorizontalAlignment = xlRight
          .VerticalAlignment = xlCenter
      End With
  
      CCAddedGPTitle.Value = "Removed from Deposit:"
      Set CCAddedGPSum = CCGPSum.Offset(1, 0)
      If CCAddedGPSum2 Is Nothing Then
          CCAddedGPSum.Borders(xlEdgeBottom).LineStyle = xlContinuous
      End If
  
      If CCGPSum.Offset(-1, 0).Text = "" Then
          Set CCGPSubtotal = CCGPSum
          Set CCGPSum = CCAddedGPSum.End(xlDown).Offset(1, 0)
          Range(CCGPSum.Offset(0, -1), CCGPSum.Offset(0, -2)).MergeCells = True
          CCGPSum.Offset(0, -1).HorizontalAlignment = xlRight
          CCGPSum.Offset(0, -2).Value = "Total:"
          CCGPSum.Interior.ColorIndex = 6
      End If
  End If
  </code></pre>