Sub TiskDoPdf()
Dim Mesic As Integer, OldSelect As Worksheet
Mesic = Sheets("Měsíc").Range("A1").Value
Set OldSelect = ActiveSheet
Sheets("Přehled").PageSetup.PrintArea = Sheets("Přehled").Range("A1:I50").Offset(0, (Mesic - 1) * 9).Address
Sheets(Array("A", "B", "C", "D", "Přehled")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\users\slay\desktop\TISK DO PDF\" & Mesic & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
OldSelect.Select
End Subcitovat