Houd er dan ook rekening mee dat het beveiligen van het 2de blad ook gevolgen heeft voor de export macro.
Sub export()
Application.ScreenUpdating = False
With Blad4
For j = .Range("C" & .Rows.Count).End(xlUp).Row To 2 Step -1
If .Cells(j, 3) < Now() - 1 Then
Blad3.Unprotect "ww"
Blad3.Range("D" & Rows.Count).End(xlUp).Offset(1, -3).Resize(, 9).Value = .Cells(j, 1).Resize(, 9).Value
.Cells(j, 1).EntireRow.Delete xlUp
Blad3.Protect "ww"
End If
Next
End With
With Application
.Goto Blad4.[a1]
.ScreenUpdating = True
End With
End Sub
Sub Re_Import()
If MsgBox("Heb je de juiste rij in kolom A geselecteerd?", vbExclamation + vbYesNo, "Waarsschuwing") = vbYes Then
Sheets("Oude gegevens").Unprotect Password:="ww"
Blad4.Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(, 9).Value = ActiveCell.Resize(, 9).Value
ActiveCell.EntireRow.Delete xlUp
Sheets("Oude gegevens").Protect Password:="ww"
Else: Exit Sub
End If
End Sub