title: VBA Code filtering a column then filling down a formula for visible cells in another column
body: <p>I'm quite new to macros but I'm trying to filter column AW then type in text that corresponds to that criteria in column AZ. Of course I'd like to fill down that text to the visible cells then repeat the process using other criteria filtered in column AZ. I'm using the below coding but it doesn't fill down column AZ, only in AZ2! I don't want the headers affected. Appreciate any help here!  -Amy</p>
  
  <pre><code>Sub Macro16()
  
  ' Macro16 Macro
  
  'Insert Column - OK
  Columns("AZ:AZ").Select
  Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
  Range("AZ1").Select
  ActiveCell.FormulaR1C1 = "Finalized Comment"
  Rows("1:1").Select
  Range("AS1").Activate
  Selection.AutoFilter
  
  
  'Filter Combined Comment for #NA then type "Style linked to a Dropped T/P"
  
  
   Dim lastRow As Long
  
   With ActiveSheet
      .Range("AW2").AutoFilter Field:=2, Criteria1:="#N/A"
      lastRow = .Range("AW" &amp; Rows.Count).End(xlUp).Row
      .Range(.Range("AZ2"), .Range("AZ" &amp; lastRow)). _
             SpecialCells(xlCellTypeVisible).Value = _
                       "Style Linked to a Dropped T/P"
   End With
  
  'Filter Combined Comment for "Confirmed Cost and Missing HTS Code" then =Combined Comment
  
   Dim lastRow As Long
  
   With ActiveSheet
      .Range("AW2").AutoFilter Field:=2, Criteria1:="Confirmed Cost and Missing HTS Code"
      lastRow = .Range("AW" &amp; Rows.Count).End(xlUp).Row
      .Range(.Range("AZ2"), .Range("AZ" &amp; lastRow)). _
             SpecialCells(xlCellTypeVisible).Value = _
                       "Confirmed Cost and Missing HTS Code"
   End With
  
  
  'Filter Combined Comment for "Unconfirmed Cost and HTS Code Present" then =Unconfirmed Cost
  
   Dim lastRow As Long
  
   With ActiveSheet
      .Range("AW2").AutoFilter Field:=2, Criteria1:="Unconfirmed Cost and HTS Code Present"
      lastRow = .Range("AW" &amp; Rows.Count).End(xlUp).Row
      .Range(.Range("AZ2"), .Range("AZ" &amp; lastRow)). _
             SpecialCells(xlCellTypeVisible).Value = _
                       "Unconfirmed Cost"
   End With
  
   'Filter Combined Comment for "Unconfirmed Cost and Missing HTS Code" then =Missing HTS
  
   Dim lastRow As Long
  
   With ActiveSheet
      .Range("AW2").AutoFilter Field:=2, Criteria1:="Unconfirmed Cost and Missing HTS Code"
      lastRow = .Range("AW" &amp; Rows.Count).End(xlUp).Row
      .Range(.Range("AZ2"), .Range("AZ" &amp; lastRow)). _
             SpecialCells(xlCellTypeVisible).Value = _
                       "Missing HTS Code"
   End With
  
  
  
  
   End Sub
  </code></pre>