hi guys ,
i have this code that prints a range from a sheet :
Sheets("voucher").Select
Cells.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A6").Select
theres another bit of code before this one that does the filtering:
' dim start/end date
Dim StartDate As Long
Dim EndDate As Long
' set start/end date cells
StartDate = CLng(Range("D4").Value)
EndDate = CLng(Range("G4").Value)
'filter sheet with records needed
Sheets("Voucher").Select
Columns("A:A").Select
Range("A7:A3101").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">=" & StartDate, Operator:=xlAnd _
, Criteria2:="<=" & EndDate
what i want is a heading at the top of the page to say :
filtered results from (sheet) : date range (startdate) - (enddate)
this is my first post for a while - just when i thought i was getting on top of vba!
davie.
i have this code that prints a range from a sheet :
Sheets("voucher").Select
Cells.Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("A6").Select
theres another bit of code before this one that does the filtering:
' dim start/end date
Dim StartDate As Long
Dim EndDate As Long
' set start/end date cells
StartDate = CLng(Range("D4").Value)
EndDate = CLng(Range("G4").Value)
'filter sheet with records needed
Sheets("Voucher").Select
Columns("A:A").Select
Range("A7:A3101").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">=" & StartDate, Operator:=xlAnd _
, Criteria2:="<=" & EndDate
what i want is a heading at the top of the page to say :
filtered results from (sheet) : date range (startdate) - (enddate)
this is my first post for a while - just when i thought i was getting on top of vba!
davie.