Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SUM function help
Hey guys I am trying to write a macro to calculate something. But I need to use variables. I have tried: ActiveCell.FormulaR1C1 = "=SUM(R[x]C:R[y]C)" where x and y are integer variables but it doesn't register this. Does anyone know how I can do this? -- jnasr00 ------------------------------------------------------------------------ jnasr00's Profile: http://www.excelforum.com/member.php...o&userid=28515 View this thread: http://www.excelforum.com/showthread...hreadid=501906 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SUM function help
dim X as long
dim Y as Long x = 6 y = 7 ActiveCell.FormulaR1C1 = "=SUM(R[" & x & "]C:R[" & y & "]C)" ====== Probably better to declare x and y as longs (not integers). jnasr00 wrote: Hey guys I am trying to write a macro to calculate something. But I need to use variables. I have tried: ActiveCell.FormulaR1C1 = "=SUM(R[x]C:R[y]C)" where x and y are integer variables but it doesn't register this. Does anyone know how I can do this? -- jnasr00 ------------------------------------------------------------------------ jnasr00's Profile: http://www.excelforum.com/member.php...o&userid=28515 View this thread: http://www.excelforum.com/showthread...hreadid=501906 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
Adding a custom function to the default excel function list | Excel Programming |