Why is my macro only populating formula in first row and not filling column of table?

56 views Asked by At

I have a macro that formats cells and populates formulas in a workbook. When testing this on a small scale, the macro worked great as it would insert the formulas in row 2 of table and table would autofill formula to bottom. I looked to use this on a .csv import which i have converted to a table. The macro is populating row 2 but the table is not autofilling it to bottom as it normally does with formulas and as it did in my simple test. I get the feeling this is something simple i am overlooking and not a result of the Macro, hoping someone has an idea of what setting to check in excel? Thanks

1

There are 1 answers

2
rotabor On BEST ANSWER

Such autofill feature works in a table only. First, you need to convert the range to a table:

ActiveSheet.ListObjects.Add(xlSrcRange,Range("$F$2:$H$13"),,xlNo).Name = _
           "Table2"

Second, the row (data area) where a formula is entered should be empty. Third, you should enter a formula to the topmost cell (below header) of the row.