Hey Everyone,
My Table's columns are updated via userform and rows via query. I have the same unlocked formula that runs across the entire table and future columns and rows.
How would you auto add the formula to the next adjacent column when it is created?
Currently fumbling with the below. Would it be better to reference the table so it's not so static?
My Table's columns are updated via userform and rows via query. I have the same unlocked formula that runs across the entire table and future columns and rows.
How would you auto add the formula to the next adjacent column when it is created?
Currently fumbling with the below. Would it be better to reference the table so it's not so static?
VBA Code:
Sub ColumnFillFormula()
Dim last_Col As Long, last_Row As Long
last_Col = Cells(221, Columns.Count).End(xlToLeft).Column
last_Row = Cells(Rows.Count, last_Col).End(xlUp).Row
Range(Cells(221, last_Col + 1), Cells(last_Row, last_Col + 1)) = "=IFNA(INDEX(CVM!$B$2:$AZ$200,MATCH($AD221,CVM!$A$2:$A$200,0),MATCH(AE$220,CVM!$B$1:$AZ$1,0)),"")"
End Sub