I'm using the below VBA to add a blank row where my data changes in my sheet. The Instruction is working fine. However, I'm trying to add a formula into the blank line that this code creates in column "C" of the inserted row.
When I added the working formula to the code after the "insert" instruction it only inserted one formula and did not continue to insert the formulas at each blank row added.
For i = WorkRng.Rows.Count To 2 Step -1
If WorkRng.Cells(i, 1).Value <> WorkRng.Cells(i - 1, 1).Value Then
WorkRng.Cells(i, 1).EntireRow.Insert
End If
Next
The working formula that I've been trying to add is:
"=IF(R[0]C[-2] > 0,"""",INDEX(ECC!R1C2:R27C2,MATCH(R[1]C[-2],ECC!C[-2],0)))"
Would anyone know how to include the insertion of a formula into the blank row insertion loop?
When I added the working formula to the code after the "insert" instruction it only inserted one formula and did not continue to insert the formulas at each blank row added.
For i = WorkRng.Rows.Count To 2 Step -1
If WorkRng.Cells(i, 1).Value <> WorkRng.Cells(i - 1, 1).Value Then
WorkRng.Cells(i, 1).EntireRow.Insert
End If
Next
The working formula that I've been trying to add is:
"=IF(R[0]C[-2] > 0,"""",INDEX(ECC!R1C2:R27C2,MATCH(R[1]C[-2],ECC!C[-2],0)))"
Would anyone know how to include the insertion of a formula into the blank row insertion loop?