+ Reply to Thread
Results 1 to 3 of 3

Dynamic FormulaR1C1 value

  1. #1
    Nuraq
    Guest

    Dynamic FormulaR1C1 value

    I have the following statement:

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

    I would like to replace the -4 with a count variable that I created:

    ActiveCell.FormulaR1C1 = "=SUM(R[-Count]C:R[-1]C)"

    This is not working. The idea is that I want to sum Count number of cells
    above my active cell.

    Help please?



  2. #2
    Tim Williams
    Guest

    Re: Dynamic FormulaR1C1 value

    ActiveCell.FormulaR1C1 = "=SUM(R[-" & Count & "]C:R[-1]C)"

    Tim

    "Nuraq" <[email protected]> wrote in message
    news:[email protected]...
    >I have the following statement:
    >
    > ActiveCell.FormulaR1C1 = "=SUM(R[-4]C:R[-1]C)"
    >
    > I would like to replace the -4 with a count variable that I created:
    >
    > ActiveCell.FormulaR1C1 = "=SUM(R[-Count]C:R[-1]C)"
    >
    > This is not working. The idea is that I want to sum Count number of
    > cells above my active cell.
    >
    > Help please?
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Dynamic FormulaR1C1 value

    ActiveCell.FormulaR1C1 = "=SUM(R[-" & _
    Count & "]C:R[-1]C)"

    --
    Regards,
    Tom Ogilvy



    "Nuraq" <[email protected]> wrote in message
    news:[email protected]...
    > I have the following statement:
    >
    > ActiveCell.FormulaR1C1 = "=SUM(R[-4]C:R[-1]C)"
    >
    > I would like to replace the -4 with a count variable that I created:
    >
    > ActiveCell.FormulaR1C1 = "=SUM(R[-Count]C:R[-1]C)"
    >
    > This is not working. The idea is that I want to sum Count number of cells
    > above my active cell.
    >
    > Help please?
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1