Hello,
Wonder if someone could help trying to build a button that will do some work for me and i am close but can not seem to get it right. Has anyone got any ideas.
Sub Save()
'
' Save1 Macro
' Saves document with date, then pdf, then alters the file and saves file for reporting.
'
'Saves file with todays date'
Dim path As String
Dim filename1 As String
path = ThisWorkbook.path & "\" 'Same path as current project that the User opened.
filename1 = "ReportName " & Format(Range("s4").Value)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=path & filename1 & ".xlsm"
Application.DisplayAlerts = True
'Saves file with todays date and pdf'
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=path & filename1 & ".pdf"
Application.DisplayAlerts = True
'Removes Unwanted Rows'
Rows("1:2").Select
Range("D1").Activate
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=6
Rows("16:24").Select
Selection.Delete Shift:=xlUp
'Saves File For Reporting'
ActiveWorkbook.SaveAs Filename:= _
"D:\" & Format(Range("s2").Value) & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Bashing me head against a wall at the moment
Wonder if someone could help trying to build a button that will do some work for me and i am close but can not seem to get it right. Has anyone got any ideas.
Sub Save()
'
' Save1 Macro
' Saves document with date, then pdf, then alters the file and saves file for reporting.
'
'Saves file with todays date'
Dim path As String
Dim filename1 As String
path = ThisWorkbook.path & "\" 'Same path as current project that the User opened.
filename1 = "ReportName " & Format(Range("s4").Value)
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=path & filename1 & ".xlsm"
Application.DisplayAlerts = True
'Saves file with todays date and pdf'
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=path & filename1 & ".pdf"
Application.DisplayAlerts = True
'Removes Unwanted Rows'
Rows("1:2").Select
Range("D1").Activate
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=6
Rows("16:24").Select
Selection.Delete Shift:=xlUp
'Saves File For Reporting'
ActiveWorkbook.SaveAs Filename:= _
"D:\" & Format(Range("s2").Value) & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End Sub
Bashing me head against a wall at the moment