Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there!
I try to put a "sum" formula in a cell: Sub putformula() Dim suma As String With Worksheets(1).Activate Cells(61, 3).Activate i = 4 j = 27 suma = "=sum(indirect(address(" & i & ";3;4)) : indirect(address(" & j & ";3;4)))" ActiveCell.Formula = suma End With End Sub When I run the macro i get the Run time error, 1004 error message, Application-defined or object-defined error If I copy the suma string from the locals window (suma = "=sum(indirect(address(4;3;4)) : indirect(address(27;3;4)))") and paste it mannualy in the cell, the formula works (it makes the sum(c4:c27). If i define suma="=sum(c4:c27)" i don't receive any error message, the macro works. I can't figure it out what i have done wrong. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I assign a value to a cell without putting a formula in it | Excel Worksheet Functions | |||
putting a string from one cell in the formula of another -- indirect needed? | Excel Worksheet Functions | |||
Putting Formula in Cell | Excel Programming | |||
putting formula in cel gives #NAME error | Excel Programming | |||
Putting Array Formula into each Cell in a Selection (that doesn'ttake eons!) | Excel Programming |