Vba excel ocultar hoja con condición
¿Disculpa lel inconveniente te hago una pregunta si quisiera ocultar la hoja en esta macro cuando le doy a cancelar como seria?
Gracias
Sub stam()
'
'ActiveSheet.Unprotect
Application.ScreenUpdating = False
Worksheets("stampa").Visible = 1
Worksheets("stampa interna").Visible = 1
With Application.FileDialog(msoFileDialogSaveAs)
.Title = "salva Come"
.AllowMultiSelect = False
.InitialFileName = "Nome"
.FilterIndex = 25 'pdf
If .Show Then march = .SelectedItems(1) Else Exit Sub
End With
Worksheets("stampa interna").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=ThisWorkbook.Path & "\" & " AZIENDA" & [B8] & [E13] & [H13], _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False 'dopia copia si abilitiamo
Worksheets("stampa").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=march, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Sheets("stampa").Select
Range("A1:I78").Select
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
Worksheets("stampa").Visible = 2
Worksheets("stampa interna").Visible = 2
'ActiveSheet.Protect
End Sub