Sub PrintTWB()
Sheet1.PageSetup.PrintArea = "$A$1:$E$36"
Sheets("Leveringsbon").PrintOut 2
Sheets("Factuur").PrintOut 1
Sheet1.PageSetup.PrintArea = ""
ActiveWorkbook.Save
MsgBox "Klaar"
End Sub
Sub safeTWB2()
On Error Resume Next
Onr = Blad2.Range("B:B").Find(Sheet1.Range("E3").Value, , xlValues, xlWhole, , , False).Row
On Error GoTo 0
If Onr > 2 Then MsgBox "Bon bestaat reeds": Exit Sub
Sheet1.PageSetup.PrintArea = "$A$1:$E$36"
'Path = "D:\Mijn Excel"
Path = "C:\Users\lucg6596\Documents\2022_Ercan\Alumena"
filepath = Path & "\" & Sheet1.Range("E3").Value
Sheet1.ExportAsFixedFormat xlTypePDF, filepath, , , False, , , False
Sheet1.PageSetup.PrintArea = ""
ActiveWorkbook.Save
'Save Offerte
Sub copycells()
'
' copycells Macro
'
' Keyboard Shortcut: Ctrl+Shift+C
'
Selection.Copy
Sheets("Omzet").Select
Range("Table1[Factuurdatum]").Select
ActiveSheet.Paste
Sheets("Factuur").Select
Range("A6:C6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Omzet").Select
Range("Table1[Klantnaam]").Select
ActiveSheet.Paste
Range("Table1[Subtotaal]").Select
Sheets("Factuur").Select
ActiveWindow.SmallScroll Down:=15
Range("E31").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Omzet").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Table1[BTW]").Select
Sheets("Factuur").Select
Range("E33").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Omzet").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
Selection.NumberFormat = _
"_-[$€-x-euro2] * #,##0.00_-;-[$€-x-euro2] * #,##0.00_-;_-[$€-x-euro2] * ""-""??_-;_-@_-"
Range("Table1[Totaal incl. BTW]").Select
Sheets("Factuur").Select
Range("E35").Select
Selection.Copy
Sheets("Omzet").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = _
"_-[$€-x-euro2] * #,##0.00_-;-[$€-x-euro2] * #,##0.00_-;_-[$€-x-euro2] * ""-""??_-;_-@_-"
ActiveWorkbook.Save
End Sub
Lastrow = Blad2.Range("B99999").End(xlUp).Row + 1
For I = 2 To 10
Blad2.Cells(Lastrow, I).Value = Sheet1.Range(Blad2.Cells(1, I).Value).Value
Next
'Nog afteboeken artikelen
For Each cl In Sheet1.Range("A16:A30")
If cl <> "" Then
iRow = Blad1.Range("A:A").Find(cl.Value, , xlValues, xlWhole, , , False).Row
Aantal = cl.Offset(0, 1).Value
TotA = Blad1.Cells(iRow, "D").Value
Blad1.Cells(iRow, "D").Value = TotA - Aantal
End If
Next
MsgBox "Klaar"
End Sub
Sub NewBon()
Application.EnableEvents = False
Range("A16:D30,C3:C4,E3:E4,C6:C9,E7,A13:E13,A11:E11").ClearContents
Sheet1.Range("E3").Value = Application.WorksheetFunction.Max(Blad2.Range("B:B")) + 1
Application.EnableEvents = True
End Sub