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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA for Excel

Status
Not open for further replies.

skong

Programmer
Joined
Jun 25, 2002
Messages
2
Location
US
Hi,
I am trying to use a variable to set the relative position in my formula, but it seems this is not right. Can this be done? If not, is there any other way to do this? I will need to paste the formula for the entire row after this.

For normalCounter = 2 To numNormal
offsetCol = offsetCol - 3
ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 _
& " +(LOG10(RC[-offsetCol]))"
Next normalCounter

skong
 
What are you trying to achieve with "RC[-offsetCol]"? Is RC a variable you have declared elsewhere?
 
Thanks for your response. I was trying to use RC[-9] to tell Excel use the cell 9 columns to the left of the current cell. RC is Excel keyword and "offsetCol" is the variable I declared. After I posted the question, the problem was solved when a friend told me that I just mixed up variables with string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top