Hello All,
I'm looking for some assistance with a macro that will do the following:
1. Take the active tab, DELETE the contents of Columns J thru K (link and macro button)
2. Save the tab as it's own file in the local folder where the "master file" currently lives that the file was copied from
3. Save the new file as the tab name, preceded by the contents of cell D5 (example. Project Apple - Apple Sales)
Screenshot of my excel sheet and code below. I appreciate the help!!
Sub SaveActiveSheet()
Dim xPath As String
Dim xWs As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With ActiveSheet
ActiveSheet.Copy
Application.ActiveWorkbook.SaveAs filename:=xPath & "\" & ActiveSheet.Name & " " & Range("N2").Value & " " & Range("N5").Value & ".xlsx"
Application.ActiveWorkbook.Close False
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
I'm looking for some assistance with a macro that will do the following:
1. Take the active tab, DELETE the contents of Columns J thru K (link and macro button)
2. Save the tab as it's own file in the local folder where the "master file" currently lives that the file was copied from
3. Save the new file as the tab name, preceded by the contents of cell D5 (example. Project Apple - Apple Sales)
Screenshot of my excel sheet and code below. I appreciate the help!!
Sub SaveActiveSheet()
Dim xPath As String
Dim xWs As String
xPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With ActiveSheet
ActiveSheet.Copy
Application.ActiveWorkbook.SaveAs filename:=xPath & "\" & ActiveSheet.Name & " " & Range("N2").Value & " " & Range("N5").Value & ".xlsx"
Application.ActiveWorkbook.Close False
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub