rc cell references
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » R1C1 Cell references

R1C1 Cell references

resolvedResolved · Urgent Priority · Version 2003

replyReplyWed 14 Jan 2009, 14:28Delegate Anthony said...

R1C1 Cell references

How do I modify the 1's in the R1C1 formula so that they are varible integers rather than absolute numbers.

For upcoming training course dates see: Pricing & availability

replyReplyWed 21 Jan 2009, 13:43Trainer Laura said...

RE: R1C1 Cell references

Hi Anthony

Thank you for your question regarding FormulaR1C1 in Excel VBA.

The property of FormulaR1C1 is refering to the format of the formula format you are entering. For example if in cell A4 you want the following formula

      =SUM(A1:A3)


You would use the following code in your VBA

      Range("A4").FormulaR1C1="=SUM(R[-4]C:R[1]C)"


The R1C1 is just part of the name of the property of the cell.

I hope that answers your question.


Laura GB

replyReplyFri 23 Jan 2009, 10:57Delegate Anthony said...

RE: R1C1 Cell references

Thank you for your response to my question. However I fear that we are talking at cross purposes. I understand that FormulaR1C1 refers to the a formula format. My question was about the use of that format.

For example with A1 type cell referencing I can write the formula

Range("A1").Value="=sum(B2:B5)"

and with FormulaR1C1 I write

Range("A1").Value="=sum(R[2]C[2]:R[5]C[2])"

However if I had declared a variable counter "Outrow" for example, I could modify my formula in A1 referencing
as follows

Range("A1").Value = WorkSheetFunction.Sum(Cells(Outrow,2),Cells(Outrow+3,2))

This has the effect of modifying the formula depending on the value of Outrow for use in a loop maybe.

My question was how do I introduce the Outrow integer above into the FormulaR1C1?

Not like this I presume
Range("A1").Value="=sum(R[Outrow]C[2]:R[Outrow+3]C[2])"


Kind regards

replyReplyFri 23 Jan 2009, 11:10Trainer Laura said...

RE: R1C1 Cell references

Hi Anthony

Thanks for the reply.

To add OutRow into the FormulaR1C1 you need to add it into the string using &. Your answer is half way there. It should be something similar to

Range("A1").Value="=sum(R[" & Outrow & "]C[2]:R[" & Outrow+3 & "]C[2])"


Let me know if that works.

Laura GB

replyReplyFri 23 Jan 2009, 11:18Delegate Anthony said...

RE: R1C1 Cell references

Thanks that works perfectly.

Kind regards

 

 

Please browse our web site to find out more about
advanced excel courses and other Microsoft training courses.

Excel tip:

Shared Conditional Formatting

In a shared workbook, conditional formats applied before the workbook was shared will continue to work; however you cannot modify the existing conditional formats or apply new ones.

View all Excel hints and tips

forum postHow do find duplicate data in excel spreadsheet

» Forum post: Duplicate items


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training