
Sub saveasPDF()
Dim LR As Long
Application.EnableEvents = False
With Sheets("TABELLE PRESENZE")
LR = .Cells(.Rows.Count, "M").End(xlUp).Row
.PageSetup.PrintArea = "A1:U" & LR
.ExportAsFixedFormat xlTypePDF, OpenAfterPublish:=True
End With
MsgBox "Elenco dei chiedenti visita salvato correttamente", vbInformation + vbOKOnly, "TABELLE PRESENZE"
Application.EnableEvents = True
End Sub
|
Sub saveasPDF()
Dim i As Integer
Dim b As Integer
Dim a As Integer
Dim Nome As String
Dim percorso As String
On Error Resume Next
percorso = "c:usersutentedesktopprova" <== da modificare
Dim LR As Long
Application.EnableEvents = False
i = 1
b = 2
With Sheets("TABELLE PRESENZE")
LR = .Cells(.Rows.Count, "M").End(xlUp).Row
For a = 37 To LR Step 37
Nome = .Range("n" & b)
.PageSetup.PrintArea = ("A" & i & ":U" & a)
.ExportAsFixedFormat xlTypePDF, Filename:=percorso & Nome & ".pdf" ,OpenAfterPublish:=True
i = i + 37
b = b + 37
Next
End With
MsgBox "Elenco dei chiedenti visita salvato correttamente", vbInformation + vbOKOnly, "TABELLE PRESENZE"
Application.EnableEvents = True
End Sub
|
Sub saveasPDF()
Application.EnableEvents = False
On Error Resume Next
b = 2
With Sheets("TABELLE PRESENZE")
nome = .Range("n" & b)
While nome <> ""
nome = .Range("n" & b)
b = b + 37
'LR = '.Cells(.Rows.Count, "M").End(xlUp).Row
Wend
b = b - 39
.PageSetup.PrintArea = "A1:U" & b
.ExportAsFixedFormat xlTypePDF, OpenAfterPublish:=True
End With
MsgBox "Elenco dei chiedenti visita salvato correttamente", vbInformation + vbOKOnly, "TABELLE PRESENZE"
Application.EnableEvents = True
End Sub
|
