PDA

View Full Version : Print ranges on worksheet



akamax_power
07-15-2008, 08:09 AM
How do i setup a custom print button that only prints 2 defined ranges from one worksheet and fits it to one page? The first range is B1:M7 and the second range is B16:M70. I've tried to just get it to print but it prints everything in between. Here's the code i've tried:


Private Sub Print_Click()

Dim hdr, phse As Range

Set hdr = Range("B1:M7")
Set phse = Range("B16:M70")

Range(hdr, phse).PrintOut
End Sub

akamax_power
07-22-2008, 11:30 AM
Is this even possible?

Thanks

mdmackillop
07-22-2008, 03:33 PM
Record a macro. That should give you the basic code. If you need more assistance, let us know.