Placing a formula in a cell of an unconstant row location

W

wfgfreedom

I'm trying to place a formula in a cell but I don't have a constant
location of the row for the cell. See the code below as an exmple:

ActiveCell.FormulaR1C1 = "=LEFT(R[YTDOrig]C[4],LEN(R[YTDOrig]C[4])-1)"

How can I place a formula in a cell to achieve the results attempted
by this code in an allowable syntax?

Frank
 
D

Dave Peterson

Maybe...

ActiveCell.FormulaR1C1 = "=LEFT(R[" & YTDOrig & "]C[4],LEN(R[" _
& YTDOrig & "]C[4])-1)"



I'm trying to place a formula in a cell but I don't have a constant
location of the row for the cell. See the code below as an exmple:

ActiveCell.FormulaR1C1 = "=LEFT(R[YTDOrig]C[4],LEN(R[YTDOrig]C[4])-1)"

How can I place a formula in a cell to achieve the results attempted
by this code in an allowable syntax?

Frank
 
W

wfgfreedom

Maybe...

ActiveCell.FormulaR1C1 = "=LEFT(R[" & YTDOrig & "]C[4],LEN(R[" _
                              & YTDOrig & "]C[4])-1)"

I'm trying to place a formula in a cell but I don't have a constant
location of the row for the cell. See the code below as an exmple:
ActiveCell.FormulaR1C1 = "=LEFT(R[YTDOrig]C[4],LEN(R[YTDOrig]C[4])-1)"
How can I place a formula in a cell to achieve the results attempted
by this code in an allowable syntax?

IT WORKED!!

Thanks for your help.

Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top