Levdbas
2/23/2017 - 11:32 AM

Code voor mijn excel document

Code voor mijn excel document

Sub Macro1()
'
' Macro1 Macro
'
' Sneltoets: Ctrl+e
'
Dim part1 As String
Dim part2 As String
Dim part3 As String
Dim part4 As String

part1 = Range("B12").Value
part2 = Range("A4").Value
part3 = Range("D10").Value
part4 = Range("B10").Value

ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & part1 & " " & part2 & " - " & part3 & " " & part4 & ".xlsx", FileFormat:=xlOpenXMLWorkbook

Sheets("Blad1").Activate
ActiveSheet.UsedRange.Select

   ThisWorkbook.Sheets(Array("Blad1")).Select
   Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:=ThisWorkbook.Path & "\" & part1 & " " & part2 & " - " & part3 & " " & part4 & ".pdf", Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
      True
End Sub