Coding a varible into the R1C1 formula format in AB for applications.

Posted on 2006-05-01
Last Modified: 2010-04-17
Need to code a sum formula into a cell using R1c1 formula

The foruula will be placed in row 3.  The range will be from row 5 to the last row of data in the column (lRow).
All in the same column. What I have does not work:

 fRow = 5
  lRow = Range("A65535").End(xlUp).Row
  pA = "=sum(R[2]C:R[lRow]C)"
  Cells(fRow - 2, 242).FormulaR1C1 = pA

 I receive a run-time error "10004". Prgram works if I substite a number for lrow but I need a varible tht changes daily and want to keep lRow

Question by:VFioramonti
    LVL 37

    Accepted Solution

    pA = "=sum(R[2]C:R[" & lRow & "]C)"

    Author Comment

    Thank you - of course. Big time help
    LVL 37

    Expert Comment

    by:Harisha M G
    Thanks for the grade !

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now