+ Reply to Thread
Results 1 to 10 of 10

Paste Values based on cell value

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Cork, Ireland
    MS-Off Ver
    Excel 365
    Posts
    149

    Paste Values based on cell value

    Hello,

    I would like to paste the formulae in specific rows with values, if specified in a cell. I've attached an example of the scenario and would appreciate any help.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Paste Values based on cell value

    Hi,

    One way

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Paste Values based on cell value

    Could you be mor specific, please?

    Condition:
    If "Y" is entered in Column F, then replace that rows formulae with values. You mean replace the values of the cells in that row with some other values? What values?

  4. #4
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Cork, Ireland
    MS-Off Ver
    Excel 365
    Posts
    149

    Re: Paste Values based on cell value

    Hi Richard,

    This works great.

    Would there be a way of having it that as soon as the user has typed 'Y' and presses enter, that the macro would fire. I tried putting the code into a Worksheet, Selection Change macro but no joy.

    Thanks.

  5. #5
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Cork, Ireland
    MS-Off Ver
    Excel 365
    Posts
    149

    Re: Paste Values based on cell value

    Hi,

    It's to replace the formulae with their resulting values, i.e. get rid of the formulae but keep the values.

    thanks

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Paste Values based on cell value

    Hi,

    If you want the macro to fire each time a Y is entered then the code is even simpler. But use the Sheet Change event. i.e.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Cork, Ireland
    MS-Off Ver
    Excel 365
    Posts
    149

    Re: Paste Values based on cell value

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    If you want the macro to fire each time a Y is entered then the code is even simpler. But use the Sheet Change event. i.e.

    Please Login or Register  to view this content.
    This is working well.

    However, something that's causing a problem is when for example, I insert new rows/columns into the list, a debug runtime error 13, type mismatch dialog appears.

    Is there any way to stop this happening?

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Paste Values based on cell value

    Hi,
    Try this to trap the situation when more than column F is involved such as in an insert row.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Cork, Ireland
    MS-Off Ver
    Excel 365
    Posts
    149

    Re: Paste Values based on cell value

    Quote Originally Posted by Richard Buttrey View Post
    Hi,
    Try this to trap the situation when more than column F is involved such as in an insert row.

    Please Login or Register  to view this content.
    Thanks Richard, this works great!

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Paste Values based on cell value

    My pleasure and thanks for the rep.

+ 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. Copy and Paste Spreadsheet based on Cell Values
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2015, 03:23 PM
  2. [SOLVED] Copy paste values to another workbook based on multiple cell values
    By Bazinga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2014, 12:41 PM
  3. [SOLVED] Sum cells based on values of another cell. Then paste that sum.
    By Thor55 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-30-2013, 10:27 AM
  4. Copy and Paste columns based on cell values
    By devin1428 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 07:50 AM
  5. Copy and Paste values based on another cell
    By clc3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2012, 05:15 PM
  6. Copy and Paste (Same worksheet) based on cell values
    By muckem333 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2011, 04:43 PM
  7. Copy Rows and Paste Based On Cell Values
    By boohah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2010, 08:58 AM

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