#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default SUM in VBA

Hi Peter,

Try something like:

'=============
Public Sub Tester()
Dim varRow As Long
Dim varRow2 As Long

varRow = 3
varRow2 = 9

ActiveCell.FormulaR1C1 = _
"=SUM(R" & varRow & "C:R" & varRow2 & "C)"

End Sub
'<<=============



---
Regards,
Norman


"PeterS" wrote in message
...
Hi,

and would like to use instead of the numbers 3 or -1 variables, but it
doesn't work.
e.g.

ActiveCell.FormulaR1C1 = "=SUM(R[varRow]C:R[varRow2]C)"

what should I do?
--
Thank you very much

PeterS



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"