+ Reply to Thread
Results 1 to 7 of 7

Macro to save all formulas as values

Hybrid View

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    home
    MS-Off Ver
    Excel 2003
    Posts
    26

    Macro to save all formulas as values

    Hi there,

    Is there such a macro to save a spreadsheet full of formulas as values instead? I'm automating a process but the tool I'm using reads the actual content of the cell, hence the need run through the spreadsheet and save all formulas as a value.


    Any guidance appreciated!

    Adri

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Macro to save all formulas as values

    Hi adrianodl,

    There is a tool called PUP 6 that has a feature I think will do your work. Find it at http://spreadsheetpage.com/index.php/pupv6/home
    You may have to buy it?
    Look at what it does on http://spreadsheetpage.com/index.php/pupv6/utilities

    Hope this is what you need.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-23-2012
    Location
    Japan
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Macro to save all formulas as values

    I found this code over the net. maybe this is what you need. Just make sure to remember that this one will not only work on the active sheet, but on the entire open workbook.
    Sub FormulasToValues_EntireWorkbook()
    'This Macro will replace all formulas from an entire workbook 
    'with their respective values. It will just changes all 
    'formulas to values.
    
    WCount = Worksheets.Count
    For i = 1 To WCount
    If Worksheets(WCount - i + 1).Visible Then
    Worksheets(WCount - i + 1).Select
    RCount = ActiveCell.SpecialCells(xlLastCell).Row
    CCount = ActiveCell.SpecialCells(xlLastCell).Column
    For j = 1 To RCount
    For k = 1 To CCount
    Worksheets(WCount - i + 1).Cells(j, k) = Worksheets(WCount - i + 1).Cells(j, k).Value
    Next k
    Next j
    End If
    Next i
    
    End Sub

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Macro to save all formulas as values

    Hi, Adri ,

    for the active sheet:

    Sub ChangeToValues_ActiveSheet()
    With ActiveSheet.UsedRange
      .Value = .Value
    End With
    End Sub
    Ciao,
    Holger

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Macro to save all formulas as values

    Now that I see the queston again, I may have given a bad answer.

    If you copy an entire sheet and paste over the top of it using "Values Only" it will replace all the formulas with their calculated values. No macros or code needed!!

    Is that what you wanted to happen?

  6. #6
    Registered User
    Join Date
    08-17-2012
    Location
    home
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Macro to save all formulas as values

    Awesome everyone!
    Will test and let me know.

    Thanks for now!

  7. #7
    Registered User
    Join Date
    08-22-2012
    Location
    Louisville, KY
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to save all formulas as values

    It is as simple as copy / paste as value. I record a macro, selecting the range, select copy from context menu and paste, either in place or on another sheet. You'll want to have a 2nd sheet with the formulas if you copy in place, if you copy to a new sheet, the formulas will be in place for the next time. If you want this to happen on a regular basis, after copy/paste as value, you may insert(in the macro) the number of rows or columns of the range, so the next copy/paste as value will have the space. Your archives continue moving to the right or down so your newest info remains on top, and you can avoid looking for the first empty row or column.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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