Active Member
May 7, 2017
Hey
i have a ? aboud a macro wher i print out a list from sheet "bogføring" but it print all out
i want it to only print out the select year i sheet "T" C2 if i change year in C2 the print out will change
and the year start in sheet "T" C4 and end in sheet "T" C5
the year can also start 1-11-21 and end 30-10-22
in sheet "bogføring" i only have 2 year now but more will com
sorry my english
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Hi,
Try this code for filtering:
Dim StartDate As Date, EndDate As Date
StartDate = ThisWorkbook.Worksheets("T").Cells(4, "C").Value2
EndDate = ThisWorkbook.Worksheets("T").Cells(5, "C").Value2
ActiveSheet.Range("$A$5:$J$2392").AutoFilter Field:=1, Criteria1:= _
">=" & CDbl(StartDate), Operator:=xlAnd, Criteria2:="<=" & CDbl(EndDate)
1 Guest(s)