Instead of copying the original file as values and then deleting the original, the macro could convert the formulas in the original to values and resave the original.
Sub Save_AS_Values()
Dim strPath As String, strFile As String, counter As Long
With Application.FileDialog(msoFileDialogFolderPicker)
.InitialFileName = "C:\Test\" 'Default path
If .Show = -1 Then strPath = .SelectedItems(1) & "\" Else Exit Sub
End With
Application.ScreenUpdating = False
strFile = Dir(strPath & "*.xls*")
Do While strFile <> ""
With Workbooks.Open(strPath & strFile)
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
.Close SaveChanges:=True
counter = counter + 1
End With
strFile = Dir
Loop
Application.ScreenUpdating = True
MsgBox counter & " files have been converted to values only.", vbInformation, "Conversion Complete"
End Sub
Bookmarks