title: Select.Autofill Destination:=Range NOT autofilling
body: <p>I have been working with VBA for about two years now, and I am having a problem I haven't had before. I am trying to autofill columns A, B, D, E and G with formulas based on the number of cells that are populated in column L. In the example shown below, cells L2-L5 are populated. With my autofill formulas, this should mean that cells A2-A5 populate, cells B2-B5 populate etc. But they don't. Only column G populates correctly, and I am stumped as to why this is happening. Any brilliant ideas?</p>
  <p>Here is my code:</p>
  <pre><code>Application.DisplayAlerts = False
  
  Sheets(&quot;QBTimecard&quot;).Select
      Range(&quot;DP2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=RC[-119]&amp;&quot;&quot;_&quot;&quot;&amp;RC[-107]&amp;&quot;&quot;_&quot;&quot;&amp;IF(RC[-2]&lt;&gt;&quot;&quot;Client Transportation&quot;&quot;,&quot;&quot;Z&quot;&quot;,&quot;&quot;XY&quot;&quot;)&quot;
      Range(&quot;DQ2&quot;).Select
      ActiveCell.FormulaR1C1 = &quot;=IF(RC[-13]&lt;=RC[-8],&quot;&quot;Pass&quot;&quot;,&quot;&quot;MMV&quot;&quot;)&quot;
      On Error Resume Next
      Selection.Autofill Destination:=Range(&quot;dp2:ds&quot; &amp; Cells(Rows.Count, &quot;A&quot;).End(xlUp).Row)
  
  Sheets(&quot;QBTimecard&quot;).Select
      Columns(&quot;DP:DP&quot;).Select
      Selection.Copy
  Sheets(&quot;PunchEntryImport&quot;).Select
      Columns(&quot;L:L&quot;).Select
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
          :=False, Transpose:=False
      Range(&quot;L1&quot;).Select
      Application.CutCopyMode = False
      ActiveCell.FormulaR1C1 = &quot;Blank&quot;
      Range(&quot;L2&quot;).Select
  
   Sheets(&quot;PunchEntryImport&quot;).Select
      Range(&quot;A2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=INDEX(QBTimecard!C,MATCH(PunchEntryImport!RC[11],QBTimecard!C[119],0))&quot;
      Range(&quot;B2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=SUMIF(QBTimecard!C[118],PunchEntryImport!RC[10],QBTimecard!C[13])/COUNTIF(QBTimecard!C[118],PunchEntryImport!RC[10])&quot;
      Range(&quot;D2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=INDEX(Lookup!C[-2],MATCH(INDEX(QBTimecard!C[9],MATCH(PunchEntryImport!RC[8],QBTimecard!C[116],0)),Lookup!C[-3],0))&amp;&quot;&quot;/1/&quot;&quot;&amp;INDEX(QBTimecard!C[10],MATCH(PunchEntryImport!RC[8],QBTimecard!C[116],0))&amp;&quot;&quot; &quot;&quot;&amp;TEXT(INDEX(QBTimecard!C[12],MATCH(PunchEntryImport!RC[8],QBTimecard!C[116],0)),&quot;&quot;HHMM&quot;&quot;)&quot;
      Range(&quot;E2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=INDEX(Lookup!C[-3],MATCH(INDEX(QBTimecard!C[8],MATCH(PunchEntryImport!RC[7],QBTimecard!C[115],0)),Lookup!C[-4],0))&amp;&quot;&quot;/1/&quot;&quot;&amp;INDEX(QBTimecard!C[9],MATCH(PunchEntryImport!RC[7],QBTimecard!C[115],0))&amp;&quot;&quot; &quot;&quot;&amp;TEXT(INDEX(QBTimecard!C[12],MATCH(PunchEntryImport!RC[7],QBTimecard!C[115],0)),&quot;&quot;HHMM&quot;&quot;)&quot;
      Range(&quot;G2&quot;).Select
      ActiveCell.FormulaR1C1 = _
          &quot;=INDEX(QBTimecard!C[103],MATCH(PunchEntryImport!RC[5],QBTimecard!C[113],0))&quot;
     On Error Resume Next
  
  'This is the portion that is not autofilling   
     Selection.Autofill Destination:=Range(&quot;a2:a&quot; &amp; Cells(Rows.Count, &quot;L&quot;).End(xlUp).Row)
     Selection.Autofill Destination:=Range(&quot;b2:b&quot; &amp; Cells(Rows.Count, &quot;L&quot;).End(xlUp).Row)
     Selection.Autofill Destination:=Range(&quot;d2:d&quot; &amp; Cells(Rows.Count, &quot;L&quot;).End(xlUp).Row)
     Selection.Autofill Destination:=Range(&quot;e2:e&quot; &amp; Cells(Rows.Count, &quot;L&quot;).End(xlUp).Row)
     Selection.Autofill Destination:=Range(&quot;g2:g&quot; &amp; Cells(Rows.Count, &quot;L&quot;).End(xlUp).Row)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/dAfVT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dAfVT.jpg" alt="enter image description here" /></a></p>