Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro - FormulaR1C1 1

Status
Not open for further replies.

Casbah

Programmer
May 18, 2004
31
IE
ActiveCell.FormulaR1C1 = "=((RC[-1])/R19C2)*100"

What I want to do is change this formula so that the "R19" isnt hard coded. I already have a variable called rowsnum which contains the value i want to use instead.

ActiveCell.FormulaR1C1 = "=((RC[-1])/R[rowsnum]C2)*100"
wont work for me, is it possible to do what I want and if so where am I going wrong?
 
Try:
ActiveCell.FormulaR1C1 = "=((RC[-1])/R" & rowsnum & "C2)*100
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top