+ Reply to Thread
Results 1 to 3 of 3

Duplicating Formulas using R1C1 format problem

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Duplicating Formulas using R1C1 format problem

    I’m working on a file with a range name dynamically updated via VBA and saved in a named range cell such as cell A1 (named “test”) in the attached workbook. The actual destination range will be four columns wide and 20-50 rows high. In this range I want to duplicate a set of formulas in a four cell named range on the same worksheet (this test file uses a two cell template – name “testfomula1”). I had success doing this before with a single cell template, or a multi-cell template on a single destination row. But I’ve never tried a multi-cell template with a multi-row destination range.

    The following line of code identifies the correct range and copies the template row into all cells in the area, but for some reason I cannot discover, it increment the row references by 2 – i.e. the row references all are odd numbers 1,3,5 through 39 vs. 1,2,3 through20. The Test button runs the macro.

    Please Login or Register  to view this content.
    Anyone have any idea why this is occurring / how to correct it? Thanks for reading & any help.
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Duplicating Formulas using R1C1 format problem

    Hi aquixano,
    maybe so
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Re: Duplicating Formulas using R1C1 format problem

    Thanks Nilem,
    You solution solves my problem, but the code’s behavior still bothered me – still haven’t found a reason why it’s incrementing the R1C1 formula but I have discovered something else. I used the R1C1 syntax because I wanted relative references. While I couldn’t find explanations for all the .formula variations, through trial and error I discovered if I modify the template row formulas to use the cell references of the first target row with .formula (vs. formualR1c1), the following code works as desired,

    Please Login or Register  to view this content.
    I don’t know why it increments properly since I thought .formula created absolute references, but I guess that’s a mystery for another day. Thanks for your help. Your suggestion got me thinking on a new path. Thanks again.

+ 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. Long formulas to breakdown R1C1 style formulas in vba
    By Dahlia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2017, 11:50 AM
  2. Inserting a Table Row and Duplicating formulas problem
    By aquixano in forum Excel General
    Replies: 7
    Last Post: 11-25-2016, 12:46 AM
  3. [SOLVED] help with VBA formulas R1C1
    By stephme55 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-30-2015, 10:13 AM
  4. Updating formulas using R1C1 syntax
    By lfeder in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2013, 04:06 PM
  5. Evaluate function with R1C1 formulas
    By eiem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2010, 05:45 AM
  6. Duplicating formulas for each row.
    By pawnraider in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-18-2008, 05:52 PM
  7. R1C1 Formulas
    By thundermocos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-17-2007, 03:21 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