Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to interpret cell references from formula to vba?

Hi,

I have recorded a few macros successfully but now have to make som
adjustements in the vba code. Specifically, I need to change the cel
reference from A2 to C5 in my formula. In my VBA code, A2 appears a
RC[-26]. What would the equivalent of C5 be in vba code format? T
avoid future such problems, what is the rule/logic behind th
translation of cell references of formulas into vba, i.e. why does A
equal RC[-26]?

Thank you for your help.

Regards,
Xlund

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default How to interpret cell references from formula to vba?

Hi
for more explanantion about the R1C1 Reference styl you may see the
Excel help (topic 'R1C1 reference')

In your case you have a relative reference:
RC[-26]]
translates to current row (R) and the column 26 positions to the left
(C[-26]) of the cell you insertert this formula

So in your case try
R[-3]C[-24]


--
Regards
Frank Kabel
Frankfurt, Germany


Hi,

I have recorded a few macros successfully but now have to make some
adjustements in the vba code. Specifically, I need to change the

cell
reference from A2 to C5 in my formula. In my VBA code, A2 appears as
RC[-26]. What would the equivalent of C5 be in vba code format? To
avoid future such problems, what is the rule/logic behind the
translation of cell references of formulas into vba, i.e. why does A2
equal RC[-26]?

Thank you for your help.

Regards,
Xlund.


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to interpret cell references from formula to vba?

Thank you Frank

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to interpret cell references from formula to vba?

You can also refer directly

RC3

gets the C column on the current row.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Xlund " wrote in message
...
Thank you Frank!


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default How to interpret cell references from formula to vba?

Your Macro recorded an R1C1 relative format. You don't have to use this. You
can reference cells in several ways:

Cell A1 = Range("A1") = ["a1"] = cells(1,1)

Also, Range("A1:G20") is valid.

There are other ways. Goto HELP and type "referring to cells".

Also, the above references are to the active worksheet. If you want to refer
to a sheet that is not the active sheet you must say so as in:

Worksheets("Sheet1").Range("A1")

TH

On 4/15/04 23:17, in article , "Xlund "
wrote:

Hi,

I have recorded a few macros successfully but now have to make some
adjustements in the vba code. Specifically, I need to change the cell
reference from A2 to C5 in my formula. In my VBA code, A2 appears as
RC[-26]. What would the equivalent of C5 be in vba code format? To
avoid future such problems, what is the rule/logic behind the
translation of cell references of formulas into vba, i.e. why does A2
equal RC[-26]?

Thank you for your help.

Regards,
Xlund.

---
Message posted from
http://www.ExcelForum.com/


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find #ref! invalid cell references within cell formula Brotherharry Excel Worksheet Functions 7 April 24th 23 07:41 PM
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Dragging a formula with cell references Sasikiran Excel Discussion (Misc queries) 8 September 25th 07 03:38 PM
cell formula references steve Excel Discussion (Misc queries) 2 July 30th 07 07:34 PM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"