snb
Verenigingslid
- Lid geworden
- 12 jun 2008
- Berichten
- 20.218
Voor wie kolommenangst heeft; voor het bestand in #11
Code:
Sub M_snb()
Application.DisplayAlerts = False
y = InputBox("kwartaal", "snb")
With Blad1.ListObjects(1).DataBodyRange
.AutoFilter 1, ">=" & DateSerial(2022, 3 * (y - 1) + 1, 1) \ 1, 1, "<" & DateSerial(2022, 3 * y + 1, 1) \ 1
.Copy
With Sheets.Add(, Sheets(Sheets.Count))
.Paste
.Copy
With ActiveWorkbook
.SaveAs ThisWorkbook.Path & "\kwartaal2.xlsx", 51
.Close 0
End With
.Delete
End With
.AutoFilter
End With
End Sub
Laatst bewerkt: