title: how to set a range to be a variable column and delete entire row if criteria is met vba
body: <p>i have a counter that will identify a specific column based on the header name.
  that counter is the variable "k" and k=5</p>
  
  <p>now in my code i need it to reference that column as my range so that i can delete that entire row where a certain criteria is met</p>
  
  <p>i have 2 issues:
  1. my range is not being set. I don't want to hardcode the range column
  2. my loop is not running</p>
  
  <pre><code>Dim physicalstr As String
  physicalstr = "Physical"
  Dim physrange As Range
  Set physrange = ShtTwo.Columns(k)
  
  For Each cell In physrange
      If ActiveCell.Value = physicalstr _
      Then ActiveCell.EntireRow.Delete
  Next cell
  </code></pre>