Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the "suma" variable is a string. If I double the quote the string that
define the formula is distorted. Thanks 4 ur advice, but is no good. I renamed the string variable with "formulastring" This how my macro looks like now: Sub putformula() Dim formulastring As String With Worksheets(1).Activate Cells(61, 3).Activate i = 4 j = 27 formulastring = "=sum(indirect(address(" & i & ";3;4)) : indirect(address(" & j & ";3;4)))" ActiveCell.Formula = formulastring End With End Sub I stepped into the macro ... when it got to the line: formulastring = "=sum(indirect(...., the locals window show the result : formulastring : "=sum(indirect(address(4;3;4)) : indirect(address(27;3;4)))" The string is absolutely perfect! If i copy the string from the locals window and paste it into the cell, the formula works!!! If I change the formula, so it doesn't contain sum or indirect or address, the macro works. Thanks again. On Mar 8, 11:06 pm, "Susan" wrote: try double quotes in your quotes in the formula......... "=sum(indirect(address("" & i & "";3;4)) ? susan |
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 |