ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel formula in VBA (https://www.excelbanter.com/excel-programming/417644-excel-formula-vba.html)

bgkgmg

Excel formula in VBA
 
How would I enter the Excel fromula SUM(A1,A3) into a macro. I am getting
confused on the different methods ie, R1C1 etc.

Thanks

Mike H

Excel formula in VBA
 
Maybe

myvalue = WorksheetFunction.Sum(Range("a1:a3"))

Mike

"bgkgmg" wrote:

How would I enter the Excel fromula SUM(A1,A3) into a macro. I am getting
confused on the different methods ie, R1C1 etc.

Thanks


Gary Keramidas

Excel formula in VBA
 
maybe this?
range("C3").Formula = "=sum(A1,A3)"

--


Gary


"bgkgmg" wrote in message
...
How would I enter the Excel fromula SUM(A1,A3) into a macro. I am getting
confused on the different methods ie, R1C1 etc.

Thanks





All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com