title: VBA Error: Object Variable or With Block variable not set
body: <p>I am new to VBA and am working on a Macro that will delete duplicate lines in a material tracking spreadsheet based off matching elements in 3 specific columns labeled: "Requisition Number", "Item", and "PO #". </p>
  
  <p>However, when I try to set activate the first element in my requisition number using <code>ActiveSheet.Range(Cells(1, colReq.Column).Address()).Activate</code> I'm given the Error: Object Variable or With Block variable not set </p>
  
  <p>The following is my full code:</p>
  
  <pre><code>Sub DeleteDuplicates()
  
  
  
      Dim sh As Worksheet
          Set sh = ThisWorkbook.Sheets("Sheet1")
  
      Dim lastRow As Long
  
          lastRow = sh.Range("A1", sh.Range("A1").End(xlDown)).Rows.Count
  
  
  
      Dim colReq As Range
      Dim colItemReq As Range
      Dim colPO As Range
      Dim colType As Range
  
      With ActiveSheet.UsedRange.Rows(1)
          Set colReq = .Find(What:="Requisition Number", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
          Set colItemReq = .Find(What:="Item", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
          Set colPO = .Find(What:="PO #", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
          Set colType = .Find(What:="PO #", LookAt:=xlWhole, MatchCase:=False, SearchFormat:=False)
      End With
  
  
      Dim current As String
      ActiveSheet.Range(Cells(1, colReq.Column).Address()).Activate
      Do While ActiveCell.Value &lt;&gt; ""
          current = ActiveCell.Address
          ActiveCell.Offset(1, 0).Activate
          Do While ActiveCell.Value &lt;&gt; ""
              If (ActiveSheet.Range(current).Value = ActiveCell.Value) And _
              ((ActiveSheet.Range(Cells(ActiveCell.Row - 1, colItemReq.Column).Address).Value) = ActiveSheet.Range(Cells(ActiveCell.Row, colItemNumber).Value)) And _
              ((ActiveSheet.Range(Cells(ActiveCell.Row - 1, colPO).Address).Value) = ActiveSheet.Range(Cells(ActiveCell.Row, colPO).Value)) And (ActiveCell.Value &lt;&gt; "Shipping Notification") Then
                  ActiveSheet.Rows(ActiveCell.Row).Delete
              Else
              ActiveCell.Offset(1, 0).Activate
              End If
          Loop
          ActiveSheet.Range(current).Offset(1, 0).Activate
      Loop
  
  
  
  End Sub
  </code></pre>