mldaigle1
asked on
Excel Macro - Fill Down Formula
Hi,
I have the following macro which fill down the formula in cell F2 down to the last row of the table, working great... but.... on the same sheet, I also need to fill down formulas on Cell L2 and N2 down to the last row.
My Macro look like this:
Sub FillDownRAM()
Sheets("Inventaire").Selec t
Range("F2").Select
If IsEmpty(ActiveCell) Then Exit Sub
Range(ActiveCell, ActiveCell.Offset(0, -1).End(xlDown).Offset(0, 1)).FillDown
End Sub
But I'm a bit lost when it's time to add other column .... Can you help?
I have the following macro which fill down the formula in cell F2 down to the last row of the table, working great... but.... on the same sheet, I also need to fill down formulas on Cell L2 and N2 down to the last row.
My Macro look like this:
Sub FillDownRAM()
Sheets("Inventaire").Selec
Range("F2").Select
If IsEmpty(ActiveCell) Then Exit Sub
Range(ActiveCell, ActiveCell.Offset(0, -1).End(xlDown).Offset(0, 1)).FillDown
End Sub
But I'm a bit lost when it's time to add other column .... Can you help?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You don't need VBA to do this. If your data is in a Table then make sure that you have formatted it as a Table. See
Overview of Excel Tables
You can even set autofill without a Table using Excel Options but the Table is best
Overview of Excel Tables
You can even set autofill without a Table using Excel Options but the Table is best
ASKER
Hi Roy_Cox,
Presently, i am manually double-clicking to fill down the formulas every single time that I have to get the inventory.
Since this is a repeatitve task i was thinking of saving time by using an additional macro in that workbook since i am already using many macros.
:- /
Presently, i am manually double-clicking to fill down the formulas every single time that I have to get the inventory.
Since this is a repeatitve task i was thinking of saving time by using an additional macro in that workbook since i am already using many macros.
:- /
ASKER
mldaigle1,
Did you try my approach of applying the formula directly??
Saurabh...
Did you try my approach of applying the formula directly??
Saurabh...
You've missed the oint. An excel Table has calculated fields i.e. the formulas auto populate, read the article that I posted a link to.
I've edited your workbook to create a Table. Now select a cell in the last row and Tab throgh that Row , when you tab to the last cell it will automatically add a new row with all formulas
inventory.xlsx
I've edited your workbook to create a Table. Now select a cell in the last row and Tab throgh that Row , when you tab to the last cell it will automatically add a new row with all formulas
inventory.xlsx
What didn't work?
If copied the formula in F2, L2 and N2 down the rows. Please see attached.
Or am I missing something?
inventory.xlsm
If copied the formula in F2, L2 and N2 down the rows. Please see attached.
Or am I missing something?
inventory.xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Roy_Cox,
I will check more closely the article and the new file.
Thanks sktneer,
Your macro is not working fine when i change the offset to -1 everywhere
Have a great day Experts!!
:)
/mld.
I will check more closely the article and the new file.
Thanks sktneer,
Your macro is not working fine when i change the offset to -1 everywhere
Have a great day Experts!!
:)
/mld.
Offset(0,-1) means, one column left to the active cell.
You're welcome mld!
You're welcome mld!
Check it out, you will find Tables are extremely useful when working with the data. Writing formulas is so much easier
Open in new window
Saurabh...