Convert formulas to its value in a folder

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
882
Hi to all of you! Kindly require to provide me support so that a VBA would convert all formulas to its values in a folder which contains around 800 files and each file contains 4 sheets. I just want to convert the first sheet's formulas named "St. Issues" without open each file. In my personal opinion I think is a complicated code but I would much appreciated if someone could support me to resolve my project. Many thanks to all of you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Run this macro, select all your files and this will covert all your formulas to values
VBA Code:
Sub CovertFormulaToValue()
    Application.DisplayAlerts = False
    Application.ScreenUpdating = False
    Dim FNum As Integer
    Dim WbIn As Workbook
    Dim ShIn As Worksheet
    Dim Selectfiles As Variant
    Dim xCll As Range
    Selectfiles = Application.GetOpenFilename(Filefilter:="Excel File (*.xls*),*xlsx*", MultiSelect:=True)
    For FNum = 1 To UBound(Selectfiles)
        Set WbIn = Workbooks.Open(Selectfiles(FNum))
        WbIn.Sheets(1).Select
        Set ShIn = WbIn.Sheets("St. Issues")
        For Each xCll In ShIn.UsedRange
            If xCll.HasFormula Then
                xCll.Formula = xCll.Value
            End If
        Next xCll
        WbIn.Save
        WbIn.Close
    Next FNum
    MsgBox "Completed!", vbInformation, "All done"
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,313
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top