+ Reply to Thread
Results 1 to 11 of 11

conditionally copy formulas and paste their values based on columnA

  1. #1
    Registered User
    Join Date
    01-28-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    8

    conditionally copy formulas and paste their values based on columnA

    Hi all.
    I think I need some help with this one...
    I have a spreadsheet column A has 10'000 rows with each row displaying either: past, present or future.
    I would like to isolate all the rows that have the word "past" in column A, but only copy and paste the values of the formulas from column D through Column N -
    This is to prevent updates to the cells after the dates have expired.
    Any help would be greatly appreciated!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: conditionally copy formulas and paste their values based on columnA

    One way is to add a new adjacent column containing sequential numbers (1,2,3 ....). Then sort by you past, present,future column. Do your copy pasting. Then sort back using your sequential numbers column.
    Martin

  3. #3
    Registered User
    Join Date
    01-28-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: conditionally copy formulas and paste their values based on columnA

    Quote Originally Posted by mrice View Post
    One way is to add a new adjacent column containing sequential numbers (1,2,3 ....). Then sort by you past, present,future column. Do your copy pasting. Then sort back using your sequential numbers column.
    I was trying to avoid doing this manually, as the rest of the sheet is macro driven.
    This sheet will be for employees to fill out, but I need to preserve the information from all past entries daily, before new updates affect the next run of tasks. since I will assign this macro to the "start" button, that they click when opening their task list first thing.
    Most of the people have never worked with computers, and I would like to make this as user friendly as possible.
    But I do appreciate your input mrice. I guess I wasn't as forthcoming that I was looking for a code.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: conditionally copy formulas and paste their values based on columnA

    Please attach your sample book with the desired result

  5. #5
    Registered User
    Join Date
    01-28-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: conditionally copy formulas and paste their values based on columnA

    I have uploaded a copy (no formulas, no codes) of the page in question.
    I need a macro (to assign to a click_button) that will copy column D through column H in each row that has the word "past" in it's column A.
    Thank You
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-28-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: conditionally copy formulas and paste their values based on columnA

    Quote Originally Posted by cmmchick View Post
    I have uploaded a copy (no formulas, no codes) of the page in question.
    I need a macro (to assign to a click_button) that will copy column D through column H in each row that has the word "past" in it's column A.
    Thank You
    Forgot...: it will copy the formulas in columns D-H (not present in the sample) and paste the values only in columns D-H

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: conditionally copy formulas and paste their values based on columnA

    Forgot...: it will copy the formulas in columns D-H (not present in the sample) and paste the values only in columns D-H .
    Not clear!
    if the value of columns A are past, you want to copy which range and where you are copying them to?
    If you are copying from the same cells to the same cells, why do you need a code?

  8. #8
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: conditionally copy formulas and paste their values based on columnA

    Presumably the requirement is to copy and then paste special /values to transform formulae into fixed values.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: conditionally copy formulas and paste their values based on columnA

    Martin,
    in that the case,the amount of time you spend running the code and using excel's function would probably are the same- assuming you are running the code on a single sheet.

  10. #10
    Registered User
    Join Date
    01-28-2013
    Location
    Indiana
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: conditionally copy formulas and paste their values based on columnA

    It does not matter how long the code runs for, it is to give the folk that are computer illiterate a chance to just click a button so this can be done for them. Having multiple people go into this massive spreadsheet, and filter, copy and paste (values only) over formulas is asking for trouble. I'd much rather have any deletion or formula done by a code, that can do this function over and over - and I don't have to train multiple people on how to do this manually. and yes, mrice, the basic requirement is to copy and then paste special /values to transform formulae into fixed values, but again only from Column D-H in the rows defined by "past" in Column A.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: conditionally copy formulas and paste their values based on columnA

    Here is the code and all you need is for you to create a button to run it

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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