Ik heb hier een macro ik heb hem via de opneem functie gemaakt en daarna nog deels ingekort maar hij blijft traag.
weet iemand misschien hoe hij nog meer ingekort kan worden of in ieder geval vlugger gemaakt kan worden???
Greetz AVA
weet iemand misschien hoe hij nog meer ingekort kan worden of in ieder geval vlugger gemaakt kan worden???
Code:
Sub Macro1()
'
' Macro1 Macro
'
End Sub
Sub Printen()
'
' Printen Macro
If Range("D4") = 0 Then MsgBox "Aantal kasten: is niet ingevuld."
If Range("D4").Value = 0 Then Range("D4").Select: GoTo 1 Else GoTo 2
1: With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
End With: GoTo getout2
2: Range("D4").Select
With Selection.Interior
.Pattern = xlNone
End With
If Range("C26") = 0 Then MsgBox "Naam klant: is niet ingevuld."
If Range("C26").Value = 0 Then Range("C26").Select: GoTo 3 Else GoTo 4
3: With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
End With: GoTo getout2
4: Range("C26").Select
With Selection.Interior
.Pattern = xlNone
End With
If Range("D26") = 0 Then MsgBox "Tel klant: is niet ingevuld."
If Range("D26").Value = 0 Then Range("D26").Select: GoTo 5 Else GoTo 6
5: With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
End With: GoTo getout2
6: Range("D26").Select
With Selection.Interior
.Pattern = xlNone
End With
If Range("E26") = 0 Then MsgBox "Adres klant: is niet ingevuld."
If Range("E26").Value = 0 Then Range("E26").Select: GoTo 7 Else GoTo 8
7: With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
End With: GoTo getout2
8: Range("E26:G26").Select
With Selection.Interior
.Pattern = xlNone
End With
If Range("H26") = 0 Then MsgBox "Email klant: is niet ingevuld."
If Range("H26").Value = 0 Then Range("H26").Select: GoTo 9 Else GoTo getout
9: With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
End With: GoTo getout2
getout: Range("H26:J26").Select
With Selection.Interior
.Pattern = xlNone
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.6)
.RightMargin = Application.InchesToPoints(0.45)
.TopMargin = Application.InchesToPoints(0.65)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintPreview
getout2:
End Sub
Greetz AVA
Laatst bewerkt: