Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have stuck in a problem,
By running a macro i should be able to sum a range of variable data. Eg:- sum of A1:D1 in E1 or sum of A1:L1 in M1 ie; exact to the next cell i want to sum all the previous cells data. Is This Possibel........? Thanks in Advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assuming you are starting in column A, all data in same row and the sum is
from Col A to the Col just to the left of your cursor, use this macro... ActiveCell.FormulaR1C1 = "=SUM(RC[-" & ActiveCell.Column - 1 & "]:RC[-1])" HTH. -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Thyagaraj" wrote: I have stuck in a problem, By running a macro i should be able to sum a range of variable data. Eg:- sum of A1:D1 in E1 or sum of A1:L1 in M1 ie; exact to the next cell i want to sum all the previous cells data. Is This Possibel........? Thanks in Advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Gary L Brown wrote: Assuming you are starting in column A, all data in same row and the sum is from Col A to the Col just to the left of your cursor, use this macro... ActiveCell.FormulaR1C1 = "=SUM(RC[-" & ActiveCell.Column - 1 & "]:RC[-1])" HTH. -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Thyagaraj" wrote: I have stuck in a problem, By running a macro i should be able to sum a range of variable data. Eg:- sum of A1:D1 in E1 or sum of A1:L1 in M1 ie; exact to the next cell i want to sum all the previous cells data. Is This Possibel........? Thanks in Advance This is working ActiveCell.FormulaR1C1 = "=SUM(RC[-" & ActiveCell.Column - 1 & "]:RC[-1])" In the above formula can we assign a variable to the column references. meaning Data may be any where on the sheet but there is reference where the sum formula should start and where it should end. ie; before the statring cell where the data should start there is a word "Ending" and exactly where the data should end there is a word "Difference" - The middle data should be only summed. Regards Thyagaraj |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert a variable dependant on content of specific cells | Excel Discussion (Misc queries) | |||
Sum of Cells if Row Contains a Specific Variable | Excel Worksheet Functions | |||
how to format only a specific character or number in each cell withina range of cells | Excel Worksheet Functions | |||
Searching for a specific cell using a variable. | Excel Programming | |||
Copying block (range of cells) based on a value of a specific cell-VBA | Excel Programming |