Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
among these two code statements which is better
activecell.Formula="=sum(a1:a5)" activecell=worksheetfunction.Sum(range("a1:a5")) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It depends on what your needs are. The first,
activecell.Formula="=sum(a1:a5)" will insert a formula, so its result will change as the values in A1:A5 changs. The second, activecell=worksheetfunction.Sum(range("a1:a5")) will return a number which will not changes as the values in A1:A5 change, unless of course you re-run the code. Without further detail, I would likely use the first approach. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "R..VENKATARAMAN" wrote in message ... among these two code statements which is better activecell.Formula="=sum(a1:a5)" activecell=worksheetfunction.Sum(range("a1:a5")) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thank you Mr. Pearson.
"Chip Pearson" wrote in message ... It depends on what your needs are. The first, activecell.Formula="=sum(a1:a5)" will insert a formula, so its result will change as the values in A1:A5 changs. The second, activecell=worksheetfunction.Sum(range("a1:a5")) will return a number which will not changes as the values in A1:A5 change, unless of course you re-run the code. Without further detail, I would likely use the first approach. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "R..VENKATARAMAN" wrote in message ... among these two code statements which is better activecell.Formula="=sum(a1:a5)" activecell=worksheetfunction.Sum(range("a1:a5")) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
ActiveCell.Formula Help | Excel Programming | |||
ActiveCell.Formula | Excel Programming | |||
activecell.formula syntax | Excel Programming | |||
Formula with an ActiveCell | Excel Programming |