ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 793
- Office Version
- 365
- 2019
- Platform
- Windows
Hello - I have the below code that works. But I wanted to know if there was a more efficient way of doing what I am trying to accomplish or a correct way I should say. All I am trying to do is export out a sheet to a new workbook removing all formulas and macro buttons then saving as.
VBA Code:
'Export file, set filters and save-as
Sheets("COMPARE").Copy
Sheets("COMPARE").Unprotect
Sheets("COMPARE").Cells.Copy
Range("A1").Select
ActiveCell.PasteSpecial xlPasteValues
ActiveSheet.Buttons.Delete
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, AllowFiltering:=True
ActiveWorkbook.SaveAs Filename:="C:\my folder.xlsm"