+ Reply to Thread
Results 1 to 4 of 4

Cell reference dynamic

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    hulst
    Posts
    6

    Cell reference dynamic

    Hi,

    in a certain formula ( ActiveCell.FormulaR1C1 = "=SUM(R[-12]C:R[-1]C)" ) i need the first reference, in this case [-12], i need to change it dynamically (with a variable ), how is this done?

    Thanks in adance

    Erwin

  2. #2
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: Cell reference dynamic

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

    Without the returns of course.

    Please Login or Register  to view this content.
    Last edited by Kalithro; 08-30-2013 at 06:42 PM.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Cell reference dynamic

    Maybe something like this...

    ActiveCell.FormulaR1C1 = "=SUM(R[" & x & "]C:R[-1]C)"
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    08-14-2013
    Location
    Florida
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: Cell reference dynamic

    Quote Originally Posted by AlphaFrog View Post
    Maybe something like this...

    ActiveCell.FormulaR1C1 = "=SUM(R[" & x & "]C:R[-1]C)"
    Yea that one... Had to edit mine.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dynamic Cell Reference?
    By cjl28 in forum Excel General
    Replies: 5
    Last Post: 10-30-2011, 05:04 PM
  2. Dynamic cell reference
    By jamie.finney in forum Excel General
    Replies: 4
    Last Post: 08-14-2010, 04:31 AM
  3. Dynamic reference to a cell
    By macaonghus in forum Excel General
    Replies: 5
    Last Post: 03-03-2009, 08:41 AM
  4. [SOLVED] Dynamic cell reference
    By Ant in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 01:20 PM
  5. Dynamic cell reference?
    By EdJ in forum Excel General
    Replies: 2
    Last Post: 08-26-2005, 12:05 PM

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