jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
Hello,
I have this code that names and saves the file, it works fine but I would like to have it save the file without having the macro's still available. The range of the data I would like to save is from A1 -J49
I have this code that names and saves the file, it works fine but I would like to have it save the file without having the macro's still available. The range of the data I would like to save is from A1 -J49
Code:
Sub man_save_to_folder()
Dim SaveRange As Range
Set SaveRange = Sheets("Weight Control Sheet").Range("p5")
Application.DisplayAlerts = False
ActiveSheet.Unprotect Password:=""
With Sheets("Weight Control Sheet")
ActiveSheet.Copy
Range("p5").Value = Range("p5").Value
End With
If SaveRange = "" Then SaveRange = _
InputBox("The workbook name is blank please type a save name", "Workbook Name")
ActiveWorkbook.SaveAs _
FileName:="N:\Engineering\Weight Control Sheets\" & SaveRange.Value & ".xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveSheet.Protect Password:=""
ActiveWorkbook.Close
Application.DisplayAlerts = True
ActiveSheet.Protect Password:=""
End Sub