A
akbnsl
Can someone please help me. I am trying to create a print marcro
where I define the cell ranges I want to be included in the print area
using input boxes and set the orientation to landscape and the margins
to 0.5" on all sides. The print area is going to have non-contigous
cell references (i.e, should print multiple pages per sheet). I want
this macro to define these print attributes for all the worksheets in
my workbook. Below is the code I have come up so far but I am having
quite a bit of trouble getting this to work. Can somebody please help
me?? Would be greatly appreciated.
ub PrintMacro()
Dim ISRng As Range
On Error Resume Next
Set ISRng = Application.InputBox _
(prompt:="Specify a range:", Type:=8)
If ISRng Is Nothing Then Exit Sub
MsgBox "You selected the following range for the income statement
" & ISRng.Address
Dim BSRng As Range
On Error Resume Next
Set BSRng = Application.InputBox _
(prompt:="Specify a range:", Type:=8)
If BSRng Is Nothing Then Exit Sub
MsgBox "You selected the following range for the income statement
" & BSRng.Address
Dim PrtArea As Range
With Worksheets.PageSetup _
.PrintArea = ISRng.Address,BSRng.Address
End Sub
where I define the cell ranges I want to be included in the print area
using input boxes and set the orientation to landscape and the margins
to 0.5" on all sides. The print area is going to have non-contigous
cell references (i.e, should print multiple pages per sheet). I want
this macro to define these print attributes for all the worksheets in
my workbook. Below is the code I have come up so far but I am having
quite a bit of trouble getting this to work. Can somebody please help
me?? Would be greatly appreciated.
ub PrintMacro()
Dim ISRng As Range
On Error Resume Next
Set ISRng = Application.InputBox _
(prompt:="Specify a range:", Type:=8)
If ISRng Is Nothing Then Exit Sub
MsgBox "You selected the following range for the income statement
" & ISRng.Address
Dim BSRng As Range
On Error Resume Next
Set BSRng = Application.InputBox _
(prompt:="Specify a range:", Type:=8)
If BSRng Is Nothing Then Exit Sub
MsgBox "You selected the following range for the income statement
" & BSRng.Address
Dim PrtArea As Range
With Worksheets.PageSetup _
.PrintArea = ISRng.Address,BSRng.Address
End Sub