i have an excel workbook with 55 sheets. I would like to save the sheets as csv files (file name is the name of the excel sheet). When i run the macro, the files are created as desired but the macro messes up the original excel workbook in that the sheets which have formulae, have their cell numbers changed. I want the excel workbook to retain the formulae for further iterations.
Macro pasted below. Can someone fix the problem? thanks in advance
Sub SaveCSV() Dim ws As Worksheet Const cstrFOLDER As String = "C:\M-C\HIST" ChDrive Left(cstrFOLDER, 1) ChDir cstrFOLDER Application.DisplayAlerts = False For Each ws In Worksheets ws.Copy ActiveWorkbook.SaveAs Filename:=cstrFOLDER & "\" & ws.Name & ".csv", _ FileFormat:=xlCSV, _ CreateBackup:=False ActiveWorkbook.Close False Next ws Application.DisplayAlerts = True End Sub