+ Reply to Thread
Results 1 to 5 of 5

Using Relative Reference in a Formula

  1. #1
    tedd13
    Guest

    Using Relative Reference in a Formula

    I am having trouble using a formula. Here is the formula I am trying to make
    work: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*Cell A1".

    The "Cell A1" is the cell that I want to reference. This formula will be
    used in mulitiple rows but it will always look for the value of cell A1. The
    problem is that it will not let me mix both relative and absolute references
    in the formula.

    I guess that I could also assign a variable with the value of cell A1 and
    use that in the formula. But I don't know how to do that either.
    Does anyone know how to do this?
    Thanks


  2. #2
    Ardus Petus
    Guest

    Re: Using Relative Reference in a Formula

    If you want to reference cell B3, enter:
    ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2"

    R3C2 is an absolutre reference to cell $B$3

    HTH
    --
    AP

    "tedd13" <tedd13@discussions.microsoft.com> a écrit dans le message de news:
    9ABE915E-3653-4EA4-950A-31B84E77DC0C@microsoft.com...
    >I am having trouble using a formula. Here is the formula I am trying to
    >make
    > work: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*Cell A1".
    >
    > The "Cell A1" is the cell that I want to reference. This formula will be
    > used in mulitiple rows but it will always look for the value of cell A1.
    > The
    > problem is that it will not let me mix both relative and absolute
    > references
    > in the formula.
    >
    > I guess that I could also assign a variable with the value of cell A1 and
    > use that in the formula. But I don't know how to do that either.
    > Does anyone know how to do this?
    > Thanks
    >




  3. #3
    tedd13
    Guest

    Re: Using Relative Reference in a Formula

    Thanks...but I still can't get it to work.

    Here is my formula: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2)"

    So I should get the value in cell B3, right? I have a value there. When I
    run it I get an Application or Object Defined Error.

    What do you think I am doing wrong?

    Thanks again.

    "Ardus Petus" wrote:

    > If you want to reference cell B3, enter:
    > ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2"
    >
    > R3C2 is an absolutre reference to cell $B$3
    >
    > HTH
    > --
    > AP
    >
    > "tedd13" <tedd13@discussions.microsoft.com> a écrit dans le message de news:
    > 9ABE915E-3653-4EA4-950A-31B84E77DC0C@microsoft.com...
    > >I am having trouble using a formula. Here is the formula I am trying to
    > >make
    > > work: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*Cell A1".
    > >
    > > The "Cell A1" is the cell that I want to reference. This formula will be
    > > used in mulitiple rows but it will always look for the value of cell A1.
    > > The
    > > problem is that it will not let me mix both relative and absolute
    > > references
    > > in the formula.
    > >
    > > I guess that I could also assign a variable with the value of cell A1 and
    > > use that in the formula. But I don't know how to do that either.
    > > Does anyone know how to do this?
    > > Thanks
    > >

    >
    >
    >


  4. #4
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    It looks to me that you're missing what digit it is to round to.
    Try this:
    ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2,0)"

    where 0 is the digit to be rounded to.

    -Ikaabod

    Quote Originally Posted by tedd13
    Thanks...but I still can't get it to work.

    Here is my formula: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2)"

    So I should get the value in cell B3, right? I have a value there. When I
    run it I get an Application or Object Defined Error.

    What do you think I am doing wrong?

    Thanks again.
    > >[/color]
    >
    >
    >[/color]

  5. #5
    tedd13
    Guest

    Re: Using Relative Reference in a Formula

    That was it!!!! Thanks

    "Ikaabod" wrote:

    >
    > It looks to me that you're missing what digit it is to round to.
    > Try this:
    > ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2,0)"
    >
    > where 0 is the digit to be rounded to.
    >
    > -Ikaabod
    >
    > tedd13 Wrote:
    > > Thanks...but I still can't get it to work.
    > >
    > > Here is my formula: ActiveCell.FormulaR1C1 = "=ROUND(RC[-1]*R3C2)"
    > >
    > > So I should get the value in cell B3, right? I have a value there.
    > > When I
    > > run it I get an Application or Object Defined Error.
    > >
    > > What do you think I am doing wrong?
    > >
    > > Thanks again.
    > > > >

    > > >
    > > >
    > > >
    [/color]
    >
    >
    > --
    > Ikaabod
    > ------------------------------------------------------------------------
    > Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
    > View this thread: http://www.excelforum.com/showthread...hreadid=540656
    >
    >[/color]

+ 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