0
Thanks

A few words of thanks would be greatly appreciated.

Excel - Rows and Columns RC - 7



Issue


I am trying to do some extensive formula writing that involves complex sheet referencing. In my attempts, I do not understand the numbers that come after the R and C in the following. They do not seem to be linear like row and column headings. Could someone explain to me how these numbers work?


ActiveCell.FormulaR1C1 = "=SAF0006!R[-1]C[3]" 
Range("C3").Select 
ActiveCell.FormulaR1C1 = "=SAF0006!R[-2]C[7]"

Solution


The square brackets are used for relative addressing :

If the active cell is C3 (third row / third column), R[-2]C[7] corresponds to J1 (2 rows backwards and 7 columns forward)

For absolute addressing, do not use the square brackets :
R2C7 corresponds to $G$2 (second row / seventh column)

Note


Thanks to Ivan-hoe for this tip on the forum.
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Excel - Rows and Columns RC - 7 », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).