+ Reply to Thread
Results 1 to 5 of 5

Copy relative formulas without using the Copy command?

  1. #1
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    Copy relative formulas without using the Copy command?

    When I execute this command I get the exact same formulas in both columns:
    wks.Columns(i + 1).Formula = wks.Columns("E").Formula

    How can I tweak this to copy relative formulas? I don't want to use the copy command.

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Copy relative formulas without using the Copy command?

    I think you have to use...

    Copy command ... in vba..

    No other way....




    Don't forget to click *

  3. #3
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    Re: Copy relative formulas without using the Copy command?

    There are always other ways

    One option is to write each formula in VBA:

    Range(i, 10).Formula = "=something" & something_dynamic & ")"
    Range(i, 11).Formula = ...
    ...
    ...
    ...

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,844

    Re: Copy relative formulas without using the Copy command?

    This isn't the kind of VBA programming I do, but I think this is where using formulaR1C1 (using R1C1 formulas) can be very useful. The thing about R1C1 formulas is that, when they are copied, the actual "text string" for the formula doesn't change. So, in VBA, we can build the formula string once (or read it from another cell), and put the same formula text string into another cell/range without modifying the formula string.

    As noted, I'm not real good with this kind of programming, but it might be worth the time and effort to research and test this kind of approach.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Contributor
    Join Date
    05-30-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    107

    Re: Copy relative formulas without using the Copy command?

    Thanks, I'll try the R1C1 format

+ 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. Insert rows (and copy formulas) using command button
    By roseme in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2014, 01:42 PM
  2. [SOLVED] Trying to copy formulas but confused with RELATIVE AND ABSOLUTE !
    By mtouhig in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2014, 02:13 PM
  3. Replies: 6
    Last Post: 08-28-2012, 12:35 AM
  4. HOW do I copy relative formulas FOR THIS?
    By MattInLa in forum Excel General
    Replies: 4
    Last Post: 02-14-2010, 06:21 PM
  5. Replies: 10
    Last Post: 05-15-2006, 03:45 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