Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Address Referencing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
In10sJP - 21 Sep 2007 16:32 GMT
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?
Chip Pearson - 21 Sep 2007 23:13 GMT
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)

Signature

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

> When generating a formula for a given cell through VBA, I need to be able
> to
[quoted text clipped - 7 lines]
> exactly this form of coding still functions properly.  Can anyone advise
> me?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.