Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading