+ Reply to Thread
Results 1 to 4 of 4

Copy & pasting formulas, whilst leaving cells with values unchanged

  1. #1
    Registered User
    Join Date
    05-03-2006
    Posts
    37

    Copy & pasting formulas, whilst leaving cells with values unchanged

    Hi all,

    I have vastly simplified my problem to make it clear what I am trying to do. In reality, the ranges I am looking at are much larger.

    I have two identically sized and formatted ranges:
    e.g. (1) B3:D5 and (2) F3:H5

    Range F3:H5 has three cells containing different formulas, all of them with absolute references so copy and pasting them to another location would not be an issue.

    Basically I want users to enter values into any of the cells in range B3:D5. And then once the user has finished entering values into range B3:D5, I want to have a macro that can paste the formulas in range F3:H5 (if needed) to the same relative locations in range B3:D5 WHILST leaving the values the user has entered into the rest of the cells in range B3:D5 intact/unchanged.

    E.g. if the three formula cells in range F3:H5 are in cells F3, G3 and H4. I want the formula in F3 to be pasted to cell B3, the formula in G3 to be pasted to cell C3 and the formula in H4 to be pasted to cell D4.

    Is it possible for a macro to find each formula cell in one range, note its relative location in the range and then paste it to the same relative location in another identically sized range? Is this complicated to do? The alternative is me painstakingly recording myself copy and pasting each formula cell back and forth.

    I tried to attach a simple file to explain what I mean and make it clearer, but I can't seem to be able to.

    Hoping someone can help.

    Kind regards

    Henry

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Copy & pasting formulas, whilst leaving cells with values unchanged

    To attach a file, Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: Copy & pasting formulas, whilst leaving cells with values unchanged

    Hello happyfingers,

    If you don't need to modify the formulas at all you can do a simple offset copy in VBA. You can either slave the VBA to operate once the last data input cell is changed or off of a button but you could do something as simple as:
    Please Login or Register  to view this content.
    I don't know if that's exactly what you're going for, but hopefully it helps.

    DarkF1ame
    Mark as "Solved" and add Reputation if applicable.

  4. #4
    Registered User
    Join Date
    05-03-2006
    Posts
    37

    Re: Copy & pasting formulas, whilst leaving cells with values unchanged

    DarkF1ame, Thank you. That will work. Very helpful. And much appreciated!

    Cheers

    Henry

+ 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. Machform pasting into excel not leaving blank cells
    By Benji Jeff in forum Excel General
    Replies: 0
    Last Post: 06-13-2017, 06:54 PM
  2. Replies: 5
    Last Post: 12-29-2016, 09:06 AM
  3. Replies: 1
    Last Post: 12-28-2016, 02:40 PM
  4. Leaving value unchanged if condition is false.
    By cmr018 in forum Excel General
    Replies: 7
    Last Post: 03-25-2015, 11:45 AM
  5. [SOLVED] leaving 3 blank rows and pasting values repeatidly
    By 13lack13lade in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2014, 08:23 PM
  6. Copy/Pasting Formulas but only changing certain values in formula
    By Useless_w/_excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2009, 06:00 PM
  7. Replies: 2
    Last Post: 07-09-2008, 06: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