Forum Discussion
sequoiacyclist
Feb 04, 2020Copper Contributor
Excel VBA Dynamic autofill formula
I need a little help from the excel gurus out there. I have a spreadsheet where column c has data that changes in the number of cells filled down. What I need to do is find the last row with data in...
Charla74
Feb 04, 2020Iron Contributor
Give this a try:
Dim Lrow As Long
Lrow = Cells(Rows.Count, 3).End(xlUp).Row
Range(“A3:A” & Lrow).FormulaR1C1 = "=LEFT(RC[2], R1C9)"
Dim Lrow As Long
Lrow = Cells(Rows.Count, 3).End(xlUp).Row
Range(“A3:A” & Lrow).FormulaR1C1 = "=LEFT(RC[2], R1C9)"
sequoiacyclist
Feb 04, 2020Copper Contributor
I tried this and it did not work. It did not copy the formula and autofill the cells going up. This is what I have:
Range("C3").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -2).Select
Lrow = Cells(Rows.count, 3).End(xlUp).Row
Range("A3:A" & Lrow).FormulaR1C1 = "=LEFT(RC[2], R1C9)"