Avatar of Conernesto
Conernesto
Flag for United States of America asked on

Access VBA code meaning

I have the below piece of code in a module. The code is run from Access and it's applied to an Excel spreadsheet. Can yo please describe what below code means as I may need to make a change?

 .Cells(44, C).Value = "=R[1]C-SUM(R[-8]C:R[-1]C)"
VBA

Avatar of undefined
Last Comment
Conernesto

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Norie

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Conernesto

ASKER
C appears to be the start column. What does the R stand for?
Daniel Pineault

R[1]C

R stands for Rows
C stands for Columns

in this form of notation the values are the offset from the current cell.  This is often referred to as R1C1 notation, see: https://bettersolutions.com/excel/formulas/cell-references-a1-r1c1-notation.htm
Conernesto

ASKER
Thank you very much.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Norie

Conernesto


As Daniel has explained the R and C in the formula refer to rows and columns, but the R here,   

   .Cells(44, C).Value =  

Open in new window

is a variable and represents the column the formula will be placed in.


Conernesto

ASKER
Great. Thank you.