Option Explicit
Public t As Double
Const AantalRijen As Long = 30000
Sub AlleMacros()
Sheets("Blad2").Activate
Sheets("blad2").Columns("A:B").Clear
Vullen
ditduurtwatlang
Sheets("blad2").Range("A1:B1") = Array("ditduurtwatlang", Timer - t)
Vullen
ditduurtalminderlang
Sheets("blad2").Range("A2:B2") = Array("ditduurtalminderlang", Timer - t)
If False Then 'vervang straks die true door false om dit deel uit te schakelen
Vullen
'ditgaatsnel
Sheets("blad2").Range("A3:B3") = Array("ditgaatsnel", Timer - t)
End If
Vullen
ditgaatook
Sheets("blad2").Range("A4:B4") = Array("ditgaatook", Timer - t)
Vullen
WissenBS
Sheets("blad2").Range("A5:B5") = Array("WissenBS", Timer - t)
End Sub
Sub Vullen()
Dim sh As Worksheet, Bereik As Range, c As Range, i As Long, t As Double
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
Set sh = Sheets("blad1")
sh.Cells.Clear
With sh.Range("B1:B" & AantalRijen) 'zoveel cellen diep
.FormulaR1C1 = "=IF(MOD(ROW(),2),ROW(),"""")" 'om en om vullen met een getal en leeg
.Value = .Value
End With
End Sub
Sub ditduurtwatlang()
Dim i As Long, t2 As Double
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
t = Timer
With ActiveWorkbook.Sheets("blad1")
For i = AantalRijen To 1 Step -1
'If i Mod 1000 = 0 Then Application.StatusBar = CStr(i) & Space(10) & Timer - t2: t2 = Timer
If .Cells(i, "b") = "" Then
.Cells(i, "b").EntireRow.Delete
End If
Next i
End With
End Sub
Sub ditduurtalminderlang()
Dim i As Long, t2 As Double
t = Timer
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveWorkbook.Sheets("blad1")
For i = AantalRijen To 1 Step -1
'If i Mod 1000 = 0 Then Application.StatusBar = CStr(i) & Space(10) & Timer - t2: t2 = Timer
If .Cells(i, "b") = "" Then
.Cells(i, "b").EntireRow.Delete
End If
Next i
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
Sub ditgaatsnel()
Dim i As Long, rng As Range, t2 As Double
t = Timer
With ActiveWorkbook.Sheets("blad1")
For i = 1 To AantalRijen
'If i Mod 1000 = 0 Then Application.StatusBar = CStr(i) & Space(10) & Timer - t2: t2 = Timer
With .Cells(i, "b")
If .Value = "" Then
If rng Is Nothing Then
Set rng = .Cells
Else
Set rng = Application.Union(rng, .Cells)
End If
End If
End With
Next i
If Not rng Is Nothing Then rng.EntireRow.Delete
End With
End Sub
Sub ditgaatook()
t = Timer
On Error Resume Next
Sheets("blad1").Range("B:B").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End Sub
Sub WissenBS()
Dim sh As Worksheet, Bereik As Range, c As Range, i As Long, c1 As Range, t2 As Double
t = Timer: t2 = Timer
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
Set sh = Sheets("blad1")
sh.AutoFilterMode = False
Set Bereik = Intersect(sh.Columns("B"), sh.UsedRange)
'.AutoFilter 1, ""
On Error Resume Next
Set c = Bereik.Range("A1")
Do
'Application.StatusBar = CStr(c.Row) & Space(10) & Timer - t2
t2 = Timer
Set c1 = c
Set c = sh.Cells(WorksheetFunction.Min(c.Offset(16200).Row, Bereik.Rows.Count + Bereik.Row), "B")
Application.StatusBar = CStr(c.Row)
'MsgBox c1.Row & vbTab & c.Row & vbTab & c1.Resize(c.Row - c1.Row).Address
c1.Resize(c.Row - c1.Row).SpecialCells(xlBlanks).EntireRow.Delete
Loop While c.Row <= Bereik.Row + Bereik.Rows.Count - 1
sh.AutoFilterMode = False
With Application
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
'MsgBox Timer - t
End Sub