Results 1 to 5 of 5

Dynamic Formula Ranges with reference to values in another cell

Threaded View

dunda1985 Dynamic Formula Ranges with... 06-16-2011, 07:07 PM
rylo Re: Dynamic Formula Ranges... 06-16-2011, 07:10 PM
TMS Re: Dynamic Formula Ranges... 06-16-2011, 07:11 PM
dunda1985 Re: Dynamic Formula Ranges... 06-17-2011, 04:31 AM
TMS Re: Dynamic Formula Ranges... 06-17-2011, 05:08 AM
  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    dublin, ireland
    MS-Off Ver
    Excel 2003
    Posts
    8

    Dynamic Formula Ranges with reference to values in another cell

    Hi guys,

    I think I posted this thread in the wrong forum originally. Was wondering if anyone could help me please:

    This should be simple to solve but I can't get my head around it. I'm using a dynamic formula to calculate formulas, however I need the dynamic reference points to equal a certain value in a certain cell. The follow code should make the problem pretty apparent:

    TheOffsetValue = Range("D1").Value
    
    Range("D10").Activate
    ActiveCell.FormulaR1C1 = "=((RC[-2]-R[-TheOffsetValue]C[-2])/R[-TheOffsetValue]C[-2])"
    So for example if the value in cell "D1" is 10, then the formula will effectively use:

    ActiveCell.FormulaR1C1 = "=((RC[-2]-R[-10]C[-2])/R[-10]C[-2])"
    Thanks in advance for your help!
    Last edited by dunda1985; 06-17-2011 at 05:45 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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