Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro - formula for end of last row
This formual would put a SUM formula 2 lines below the end of your data in
Column E. Hope this example helps. '/==================================/ Range("E" & _ (ActiveSheet.Cells.SpecialCells(xlLastCell).Row _ + 2)).FormulaLocal = _ "=Sum(E2:E" & _ ActiveSheet.Cells.SpecialCells(xlLastCell).Row & ")" '/==================================/ -- Gary Brown Please rate this posting if it is helpful to you. "JN" wrote: Hi, I want to set up a macro to have different formulas on the last row of the worksheet. Each month, the amount of data is different. This is what the macro to do: two rows below the last row of the data, set up formulas in column E, L to R. Each formula ties to data from the last row. I tried to set up the macro using selection.end(xlsDown), somehow, I can't make it to work. Please help. Thanx |
#2
|
|||
|
|||
Thanks, Gary.
Does that mean I can change anything after the " = Sum" formula? I won't be using SUM formula. I want to set up a formula to pull data from the last row "Grand total" and divide it with a constant on the first row. JN "Gary Brown" wrote: This formual would put a SUM formula 2 lines below the end of your data in Column E. Hope this example helps. '/==================================/ Range("E" & _ (ActiveSheet.Cells.SpecialCells(xlLastCell).Row _ + 2)).FormulaLocal = _ "=Sum(E2:E" & _ ActiveSheet.Cells.SpecialCells(xlLastCell).Row & ")" '/==================================/ -- Gary Brown Please rate this posting if it is helpful to you. "JN" wrote: Hi, I want to set up a macro to have different formulas on the last row of the worksheet. Each month, the amount of data is different. This is what the macro to do: two rows below the last row of the data, set up formulas in column E, L to R. Each formula ties to data from the last row. I tried to set up the macro using selection.end(xlsDown), somehow, I can't make it to work. Please help. Thanx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Insert macro into formula | Excel Worksheet Functions | |||
Creating a check mark box | Setting up and Configuration of Excel | |||
Problem with VBA returning the contents of a long formula. | Excel Discussion (Misc queries) | |||
Fill Formula - Macro | Excel Discussion (Misc queries) |