Address Referencing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When generating a formula for a given cell through VBA, I need to be able to
combine a relative reference (of form of R[x]C[y]) and an address retrieved
from a different sheet (of form Sheet1!A12). When the VBA accomplishes this,
the cell reference is invariably returned as a literal value: 'A12' and no
longer functions as a cell reference. This seems new to Excel 2003 and is
extremely unhelpful. However, any VBA coding I made in Excel 2000 with
exactly this form of coding still functions properly. Can anyone advise me?
 
I'm not sure what you're after, but perhaps the following will shed some
light:

Range("C10").Formula = Application.ConvertFormula("=R[-1]C[-2]", _
xlR1C1, xlA1, , relativeto:=ActiveCell) & _
"+" & Range("F1").Address(False, False)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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

Back
Top