title: Excel VBA autofill based on dynamic range
body: <p>Please can you help with the below; I have an increasing list of staff listed in A1, and I want my formulas in E1, F1, G1, etc. to be autofilled and not static like I have now.</p>
  
  <p>I have the below but its throwing up the error: Method 'Range' of object '_Global' failed  </p>
  
  <p>My vba code;</p>
  
  <pre><code>Sub AutoFill()
  
      Dim RowCount As Variant
  
      RowCount = Range(("A1"), Range("A1").End(xlDown)).Rows.Count
      Range("E1").Select ' Default formula's in E1
      Selection.AutoFill Destination:=Range(RowCount - 1), Type:=xlFillDefault
  
  End Sub
  </code></pre>
  
  <p>What am I missing, i'm stumped and have been since yesterday... </p>
  
  <p>Thanks in Advance.</p>