Grazie per l’aiuto e buona serata a tutti.
Questa è la macro:
- Codice: Seleziona tutto
Sub StampaElenco()
Sheets("Elenco").Visible = True
Sheets("Elenco").Select
Dim rArea As Range
Dim cl As Range
Dim Ok As VbMsgBoxResult
Ok = MsgBox("Stampare l’Elenco?", vbYesNo)
If Ok = vbYes Then
Application.ScreenUpdating = False
With Foglio2
Set rArea = .Range("B10:B610")
.Visible = True
For Each cl In rArea
If cl.Value = "" Then .Rows(cl.Row).Hidden = True
Next cl
.PageSetup.PrintArea = "A1:G618"
.PrintOut
.PageSetup.PrintArea = ""
rArea.EntireRow.Hidden = False
.Visible = True
End With
Application.ScreenUpdating = True
Set rArea = Nothing
End If
Sheets("Elenco").Visible = False
End Sub