I have a table similar to this:
I have a formula in Column A2.
I want to transfer it and use it automatically for the whole column. However, I tried possible and impossible ways to do it, but none of them worked. I also looked at forums such as. here: vba to drag down formula/data from last filled row to next row etc.
I don't have all the data filled in the table, so I want "excel" to look for the last row in which the record is and try to calculate the formula and return it to the last cell in column A.
(The formula joins the text together)
There is an error in the last two lines.
The formula is applied to cell A2 only. Does not continue downwards.
Thanks
I have a formula in Column A2.
I want to transfer it and use it automatically for the whole column. However, I tried possible and impossible ways to do it, but none of them worked. I also looked at forums such as. here: vba to drag down formula/data from last filled row to next row etc.
I don't have all the data filled in the table, so I want "excel" to look for the last row in which the record is and try to calculate the formula and return it to the last cell in column A.
(The formula joins the text together)
Formula | Note | Datum | I am very happy because I am | Years | years old |
=CONCATENATE(TEXT($C$2;"dd-mm-yyyy");$D$1;E2;$F$1) | Any word, TEXT | 01.04.2021 | 21 | ||
↓ |
There is an error in the last two lines.
The formula is applied to cell A2 only. Does not continue downwards.
VBA Code:
Sub AutofilCol()
' Apply to the entire column Autofill
Range("A1").Offset(1, 0).Activate
ActiveCell.FormulaR1C1 = _
"=CONCATENATE(TEXT(R2C3,""dd-mm-yyyy""),R1C4,RC[4],R1C6)"
' AutoFill
Selection.AutoFill Destination:=Range("A2:A").End(xlDown).Row
ActiveCell.EntireColumn.AutoFit
End Sub
Thanks