VBA Code om macro's in te schakelen en uit te schakelen

Status
Niet open voor verdere reacties.

JeroenK

Gebruiker
Lid geworden
21 sep 2009
Berichten
27
Beste Helpers!

Ik zit met een VBA probleempje. Ik heb een knop gemaakt met een macro. Deze macro verloopt in principe vrij snel, dus dat is geen probleem. Echter worden alle andere functies in excel enorm traag! (bijvoorbeeld het invoegen van een nieuwe kolom. Dit duurt 4 tot 5 minuten...:o)

Nu heb ik ontdekt dat dit alleen gebeurt als ik mijn macro's inschakel. Voordat ik deze instelling wijzing werkt namelijk alles prima. Alleen dus na het draaien van de Macro wordt excel onbruikbaar...

De vraag is nu: is er een VBA code om de macro's in te schakelen en na gebruik ook weer uit te schakelen?

Andere suggesties zijn natuurlijk altijd welkom :thumb::D

Vriendelijke groet,


Jeroen
 
En wat doet die macro? Het lijkt er op alsof hij zijn taak niet helemaal af (kan) maken... Of dat er nog een proces door blijft lopen.
 
Het bestand is erg groot en zal ik dus niet toevoegen. Wel heb ik hieronder de uitleg gegeven. Kanttekening: ik snap vrijwel niets van VBA codes, vandaar de omslachtigheid van de codes...

Achtereenvolgens doet de code het volgende:
Verborgen bladen opnenen > het weeknummer uit 'Rapport!' gebruiken als filter in 'Blad3!' > waarden uit 'Blad3!' kopieren naar 'Blad4!' > zoeken op maandag naar waarden ("O", "M", "N" etc.) > als gevonden dan plakken in tabblad 'Maandag!' (dit geldt voor alle dagen in de week) > in 'Rapport!' (met de ALS functie) de gegevens plaatsen op de goede plek onder elkaar om een overzichtelijk rapport te bouwen.

Ik hoop dat het te begrijpen is :P het is namelijk nogal omslachtig...
 
Het bestand is erg groot en zal ik dus niet toevoegen. Wel heb ik hieronder de uitleg gegeven. Kanttekening: ik snap vrijwel niets van VBA codes, vandaar de omslachtigheid van de codes...

Achtereenvolgens doet de code het volgende:
Verborgen bladen opnenen > het weeknummer uit 'Rapport!' gebruiken als filter in 'Blad3!' > waarden uit 'Blad3!' kopieren naar 'Blad4!' :
Code:
     Dim Weeknummer As Integer
 
        Sheets("Blad3").Visible = True
        Sheets("Blad4").Visible = True
        Sheets("Maandag").Visible = True
        Sheets("Dinsdag").Visible = True
        Sheets("Woensdag").Visible = True
        Sheets("Donderdag").Visible = True
        Sheets("Vrijdag").Visible = True
        Sheets("Zaterdag").Visible = True
        Sheets("Zondag").Visible = True


        Weeknummer = Range("Weeknummer").Value
        Sheets("Blad3").Select
        ActiveSheet.Range("$A$1:$CE$2124").AutoFilter Field:=1
        ActiveSheet.Range("$A$1:$CE$2124").AutoFilter Field:=1, Criteria1:=Weeknummer
        Rows("1:2000").Select
        Selection.Copy
        Sheets("Blad4").Select
        Rows("1:8").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False



    Application.Goto Reference:="Maandag"
    Selection.ClearContents
    
    Application.Goto Reference:="Dinsdag"
    Selection.ClearContents
    
    Application.Goto Reference:="Woensdag"
    Selection.ClearContents
        
    Application.Goto Reference:="Donderdag"
    Selection.ClearContents
    
    Application.Goto Reference:="Vrijdag"
    Selection.ClearContents
    
    Application.Goto Reference:="Zaterdag"
    Selection.ClearContents
    
    Application.Goto Reference:="Zondag"
    Selection.ClearContents


> zoeken op maandag naar waarden ("O", "M", "N" etc.) > als gevonden dan plakken in tabblad 'Maandag!' (dit geldt voor alle dagen in de week):
Code:
Dim cl As Range

 For Each cl In Sheets("Blad4").Range("E2:DZ2")
    
    If cl = "O" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-1, 0).Copy Sheets("Maandag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
    
For Each cl In Sheets("Blad4").Range("E3:DZ3")
       
    If cl = "O" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-2, 0).Copy Sheets("Dinsdag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
    
For Each cl In Sheets("Blad4").Range("E4:DZ4")
    
    If cl = "O" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-3, 0).Copy Sheets("Woensdag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
    
For Each cl In Sheets("Blad4").Range("E5:DZ5")
    
    If cl = "O" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-4, 0).Copy Sheets("Donderdag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
     
For Each cl In Sheets("Blad4").Range("E6:DZ6")
    
    If cl = "O" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-5, 0).Copy Sheets("Vrijdag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
      
For Each cl In Sheets("Blad4").Range("E7:DZ7")
    
    If cl = "O" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-6, 0).Copy Sheets("Zaterdag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next
  For Each cl In Sheets("Blad4").Range("E8:DZ8")
    
    If cl = "O" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
    If cl = "D" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 3).End(xlUp).Offset(1)
    If cl = "M" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    If cl = "N" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    If cl = "" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "RV" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    If cl = "V" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 7).End(xlUp).Offset(1)
    If cl = "LZ" Then cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 8).End(xlUp).Offset(1)
    
    If cl = "OM" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
    End If
    
    If cl = "MN" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "NO" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 6).End(xlUp).Offset(1)
    End If
    
    If cl = "OMN" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
    End If
    
    If cl = "OT" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 9).End(xlUp).Offset(1)
    End If
    
    If cl = "MT" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 10).End(xlUp).Offset(1)
    End If
    
    If cl = "NT" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 11).End(xlUp).Offset(1)
    End If
        
    If cl = "OE" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 12).End(xlUp).Offset(1)
    End If
    
    If cl = "ME" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 13).End(xlUp).Offset(1)
    End If
    
    If cl = "NE" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 14).End(xlUp).Offset(1)
    End If
        
    If cl = "OR" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 15).End(xlUp).Offset(1)
    End If
    
    If cl = "MR" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 16).End(xlUp).Offset(1)
    End If
            
    If cl = "NR" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 17).End(xlUp).Offset(1)
    End If
        
    If cl = "OS" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 2).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 18).End(xlUp).Offset(1)
    End If
    
    If cl = "MS" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 4).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 19).End(xlUp).Offset(1)
    End If
    
    If cl = "NS" Then
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 5).End(xlUp).Offset(1)
        cl.Offset(-7, 0).Copy Sheets("Zondag").Cells(Rows.Count, 20).End(xlUp).Offset(1)
    End If
    
    Next

> bladen weer sluiten:
Code:
    Sheets(Array("Blad3", "Blad4", "Maandag", "Dinsdag", "Woensdag", "Donderdag", _
        "Vrijdag", "Zaterdag", "Zondag")).Select
    Sheets("Zondag").Activate
    ActiveWindow.SelectedSheets.Visible = False

> in 'Rapport!' (met de ALS functie) de gegevens plaatsen op de goede plek onder elkaar om een overzichtelijk rapport te bouwen.

Ik hoop dat het te begrijpen is het is namelijk nogal omslachtig...
 
Laatst bewerkt:
Hallo !

Je "omsclachtige" macro wordt toch slechts gestart nadat je op de knop hebt geklikt?
Hoe kan die dan de andere functies vertragen?

Kan je de tip van OctaFish testen door het workbook te openen, macro's inschakelen en dan bijvoorbeeld een kolom in voegen.
Dat zou in principe snel moeten gebeuren, want je macro heeft op dat moment nog niet gedraaid.

@OctaFish: Zou een workbook trager kunnen worden als er een macro is zit die nog niet gedraaid heeft?

Grtz,
MDN111.
 
Ik heb het even getest en dit is het resultaat:

Macro's uitgeschakeld = snel
Macro's ingeschakeld (zonder macro te runnen) = traag
Macro's ingeschakeld (inclusief macro runnen) = traag

Het lijkt dus te liggen aan de optie 'macro inschakelen'... :shocked:
 
Staat er wellicht een verwijzing in ThisWorkbook?
 
Ik weet niet precies wat u bedoeld maar als ik kijk in ALT + F11 en dan bij ThisWorkbook is deze leeg. In de codes wordt ook niet verwezen naar This Workbook...
 
Is Excel alleen traag bij dit ene bestand, of heb je ook last bij andere bestanden?
 
Nee, alleen dit bestand! Alle andere programma's werken prima (ook andere office programma's...)
 
Hallo JeroenK,

Hoe groot is je bestand?


Ik heb zelf soms het probleem dat indien ik met een of meerdere tabellen werk dat er iets gebeurd (wat ben ik nog niet achter) dat het bestand extreem groot maakt voor excel begrippen. Soms 3 tot 4 mb groot. Dit maakt Excel zeer traag.

Ik weet niet of dit het zou kunnen zijn, maar je zou onderstaande kunnen proberen.
Misschien verstandig om bijvoorbeeld eens te proberen om de tabbladen apart naar een nieuw excel document te kopieren (rechtermuisknop op tabblad) en dan per blad op te slaan en dan kijken wat er gebeurd! Indien dit het is, dan kom je er vanzelf achter in welke sheet "het" probleem zit.

Suc6.

aPh
 
Laatst bewerkt:
Misschien een Event-macro in de bladmodule van Blad3 ? Al eens geprobeerd van Berekenen op manueel te zetten ?
 
@ aph: Ik heb het geprobeerd om de documenten te splitsen op allerlei manieren maar ik kom er niet achter waar dit probleem zit :o... Hij werkt soms wel en soms niet. Als het niet werkt ligt het wel altijd aan het inschakelen van macro's....

@ Warme bakkertje: Bedoeld u dat er een Event-macro moet worden toegevoegd of zit in deze event een fout?
 
Een event-macro is een macro die door een bepaalde handeling automatisch gestart wordt bv het wisselen van cel, het wijzigen van een cel, het activeren van een blad. Aangezien je zelf zegt dat de vertraging slechts begint door het inschakelen v/d macro's wordt er ergens een proces gestart als jij een bepaalde handeling uitvoert.Het draaienvan jouw macro kan geen effect hebben op andere functies binnen XL. Hij kan misschien wat verbeterd worden maar dit heeft slechts invloed op de verwerkingssnelheid van jouw macro zelf. Ik zou dus allereerst eens in alle bladmodules kijken of er daar niets in staat.
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan