excel_learnerz
Board Regular
- Joined
- Dec 12, 2018
- Messages
- 73
Hello amazing people,
I was wondering can you help me with the below
This is a current macro that I am using that copies everything (format, tab names, add data) and doesn't have formulas, removes the macros from the file also, works wonderfully, but is there a way to save the new excel into the same location automatically instead of manually saving it
Sub formula_removal()
Dim anySheet As Worksheet
ActiveWorkbook.Sheets.Copy
For Each anySheet In ActiveWorkbook.Worksheets
anySheet.UsedRange.Copy
anySheet.UsedRange.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Next
Application.DisplayAlerts = False
Sheets("sheet4").Delete
Sheets("sheet5").Delete
Sheets("sheet6").Delete
Sheets("sheet7").Delete
Sheets("sheet8").Delete
Sheets("sheet9").Delete
Sheets("sheet10").Delete
Sheets("sheet11").Delete
Application.DisplayAlerts = True
End Sub
Thanks
I was wondering can you help me with the below
This is a current macro that I am using that copies everything (format, tab names, add data) and doesn't have formulas, removes the macros from the file also, works wonderfully, but is there a way to save the new excel into the same location automatically instead of manually saving it
Sub formula_removal()
Dim anySheet As Worksheet
ActiveWorkbook.Sheets.Copy
For Each anySheet In ActiveWorkbook.Worksheets
anySheet.UsedRange.Copy
anySheet.UsedRange.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Next
Application.DisplayAlerts = False
Sheets("sheet4").Delete
Sheets("sheet5").Delete
Sheets("sheet6").Delete
Sheets("sheet7").Delete
Sheets("sheet8").Delete
Sheets("sheet9").Delete
Sheets("sheet10").Delete
Sheets("sheet11").Delete
Application.DisplayAlerts = True
End Sub
Thanks