0

This code is supposed to make a formula go from C9 until the last row used in C. I am using UsedRange because from C1 to C9, there are empty values.

lastrow = ws1.UsedRange.Rows.Count

ws1.Range("C9:C" & lastrow).Formula = _
    "=INDEX(Tableau_Employés[EMPLOYÉ],MATCH('Overtime KRONOS'!$A9,Tableau_Employés[ORDRE D''ANCIENNETÉ]))"

However this pastes the formula too far, going 11 rows after the last row. I'm not sure why.

Jade
  • 77
  • 1
  • 14

1 Answers1

0

Changed to

lastrow = ws1.Range("A" & Rows.Count).End(xlUp).Row

Jade
  • 77
  • 1
  • 14