print rows within a date range - help needed

fenster

Board Regular
Joined
Nov 11, 2002
Messages
98
hi Guys,

heres my problem:

I Have a 3 sheet workbook 1.voucher 2.exam 3.report

on both sheet 1 and 2 - column one is a date column : dd/mm/yyyy

on sheet 3 i run reports on the other 2 sheets using SUMPRODUCT

example:

=SUMPRODUCT((Voucher!$A$7:$A$2099>=D4)+0,(Voucher!$A$7:$A$2099<=G4)+0,(Voucher!$C$7:$C$2099<>"")+0)

the sum product is searching through voucher range a7 -> a2099
- the d4 is a cell in reports with the start date and g4 has the end date that the user enters

i want to add the facility to print the rows between the date specified in d4 and g4 with a command button in sheet reports.

i found this snippet of code here and tried to change to suit me with no luck


range("b6:c6")
with selection
.printout
end with

i tried

range("reports!d4,g4")
with selection
.printout
end with

can anyone help please?

much appriciated for looking - if you dont have a solution advice is warmly accepted ;)


davie


as an afterthought - it would be nice to choose whether to print range in both sheets or individually!!!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,221,692
Messages
6,161,336
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top