Sub Gegevens_laden()
Dim sh As Worksheet, Po As Worksheet, fil
Set Po = Sheets("periode overzicht")
fil = InputBox("wat is het filiaalnummer? ")
If fil <> "" Then
'Bestand wordt leeg gemaakt
Dim lr1 As Integer, p As Integer, y As Integer
With Sheets("Periode overzicht").Columns("A:I")
.Font.FontStyle = "Standaard"
.ClearContents
End With
For Each sh In Sheets
If sh.Name <> Po.Name Then
With sh.Cells(1).CurrentRegion
.AutoFilter 1, fil
If .SpecialCells(12).Count / .Columns.Count > 1 Then .Copy Po.Cells(IIf(Po.Cells(1) = "", 1, Po.Cells(Rows.Count, 1).End(xlUp).Row + 2), 1)
.AutoFilter
End With
End If
Next sh
End If
End Sub
Sub Gegevens_laden()
Dim sh As Worksheet, Po As Worksheet, fil
Set Po = Sheets("periode overzicht")
fil = InputBox("wat is het filiaalnummer? ")
If fil <> "" Then
'Bestand wordt leeg gemaakt
Dim lr1 As Integer, p As Integer, y As Integer
With Sheets("Periode overzicht").Columns("A:I")
.Font.FontStyle = "Standaard"
.ClearContents
End With
For Each sh In Sheets
If sh.Name <> Po.Name Then
With sh.Cells(1).CurrentRegion
.AutoFilter 1, fil
If .SpecialCells(12).Count / .Columns.Count > 1 Then .Copy Po.Cells(IIf(Po.Cells(1) = "", 1, Po.Cells(Rows.Count, 1).End(xlUp).Row + 2), 1)
.AutoFilter
End With
End If
Next sh
End If
End Sub