
Sub salva()
Dim file As String, Pat As String
Pat = ThisWorkbook.Path & "" 'nella stessa cartella dove è salvato
file = Sheets("Foglio4").Cells(12, 1) & ".xlsx"
Application.ScreenUpdating = False
'Sheets("Foglio1").Select
'Cells.ClearContents
Sheets("Foglio4").Select
ActiveSheet.Copy 'crea una nuova cartella
ActiveWorkbook.SaveAs Pat & file
ActiveWorkbook.Close
Cells.ClearContents
Application.ScreenUpdating = True
End Sub |
Sub salva()
Dim file As String, Pat As String
Pat = ThisWorkbook.Path & "" 'nella stessa cartella dove è salvato
file = Sheets("Foglio4").Cells(12, 1)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets("Foglio4").Select
Sheets("Foglio1").Delete
ActiveSheet.Copy 'crea una nuova cartella
ActiveWorkbook.SaveAs Pat & file & ".xlsx"
ActiveWorkbook.Close
Sheets("Foglio4").Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
ActiveWorkbook.Close True
End Sub |
