+ Reply to Thread
Results 1 to 14 of 14

Convert all the formulas into values except the rows contain Sum

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Convert all the formulas into values except the rows contain Sum

    Dear Experts,

    I have a macro that extracts worksheets from a central workbook into a new workbook and with a short macro that converts the formulas contained into values. However, i am looking for a simple code that would convert all the other formulas to values except the rows that contain excel function "Sum() or Subtotal()". Find below the current code used in converting to values.

    Please Login or Register  to view this content.
    Many thanks in advance for your help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Convert all the formulas into values except the rows contain Sum

    I cant help with your question , but I would ask - if you are already converting formulas to values, and those values go into a SUM or SUBTOTAL, if that is all that makes up those SUM, thejn why not just convert them too? (I understand possibly wanting to keep teh SUBTOTAL
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    Keeping the sum formulas rather than converting them to values is to help the users that might want to further insert lines or data and wouldnt want to start adding all the sum formulas to get the their most up to date figures.

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Convert all the formulas into values except the rows contain Sum

    Hi kay007,

    Try this (initially on a copy of your data as the results cannot be undone if they're not as expected):

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Convert all the formulas into values except the rows contain Sum

    Quote Originally Posted by kay007 View Post
    Keeping the sum formulas rather than converting them to values is to help the users that might want to further insert lines or data and wouldnt want to start adding all the sum formulas to get the their most up to date figures.
    OK, thats makes sense

  6. #6
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    Thanks Robert for that code..However, the macro wiped out all the formulas including the cells containing "SUM" or "SUBTOTAL".

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Convert all the formulas into values except the rows contain Sum

    Try changing the word "OR" to "AND" in this line of code.
    Please Login or Register  to view this content.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  8. #8
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    Thanks Skywriter. I tried your suggestion and i noticed that the "SUMIF" were not converted to values like the others. I only want the Sum and subtotal functions to be the available ones in the report. All others should be converted to values..

    Many thanks once again for your time.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Convert all the formulas into values except the rows contain Sum

    Can you provide a sample sheet with some dummy data?

  10. #10
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    Thanks all for the time taken so far in helping out. Much appreciated

    Please find attached a sample report.

    Book4.xlsx

    All the other formulas should be values except the row containing Total (Sum or Subtotal).

    Many thanks once again.

  11. #11
    Registered User
    Join Date
    04-22-2013
    Location
    Philippines & Australia
    MS-Off Ver
    Excel 2016, Office 365
    Posts
    73

    Re: Convert all the formulas into values except the rows contain Sum

    Try This Slight amendment
    Please Login or Register  to view this content.

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Convert all the formulas into values except the rows contain Sum

    Does this help?

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    That works fine Catman50. Thanks a lot Catman50, Trebor76,FDibbins, and skywriter for taking out time to work on this issue.

    Very much appreciated.

    Regards,
    Kay007

  14. #14
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Lagos, Nigeria
    MS-Off Ver
    Excel 2007, 2010, 2016
    Posts
    102

    Re: Convert all the formulas into values except the rows contain Sum

    Thanks JOHN H. DAVIS. it worked on my sample data as well. Many thanks

+ 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. [SOLVED] Convert Values to formulas
    By TSter in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-19-2021, 11:41 PM
  2. [SOLVED] VBA to enter various formulas every 10 rows and show dynamic formulas not values
    By faby2203 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2013, 07:05 AM
  3. Execute all formulas before convert to values
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2013, 02:15 PM
  4. Convert formulas to values for specific rows
    By Mike361 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2012, 02:25 PM
  5. Convert formulas to values
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2011, 07:38 AM
  6. Convert IF formulas to their values
    By GregR in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2006, 04:55 PM
  7. convert formulas to values
    By MatthewFlinchem in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-17-2006, 11:45 AM
  8. Convert formulas to values on save
    By Steve B in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2005, 05:25 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