print from cell reference

kavanagh

Board Regular
Joined
Apr 1, 2009
Messages
155
Is it possible to select a sheet to print with a range within that cell to print

'TUNNEL-B SIDE
Private Sub Worksheet_Calculate()
If Range("E10").Value >= 186 Then
Application.EnableEvents = False
Workbooks.Open Filename:="DIV F-SHIPPING.xls"
Sheets(1) ("A2:AR83"). PrintOut
ActiveWorkbook.Close False
Application.EnableEvents = True
End If
I'm not sure how to add this range to this event I know this dosen't.

any help appreaciated K
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You have to set the print area first. Something like this
Code:
With Sheet1.PageSetup
   .PrintArea = "$A$2:$C$5"
End With
Sheet1.PrintOut

lenze
 
Upvote 0
Thank you for responding, but my inability to grasp how to write code dosen't help
I can't get it to work ,the original code takes me to another workbook. when I add that new bit to it it just takes me to sheet 1 within the same workbook and prints it instead of opening div f shipping workbook,
here's how I added your code I probably misunderstood
I'm not sure what $ dose

Private Sub Worksheet_Calculate()
If Range("E10").Value >= 186 Then
Application.EnableEvents = False
Workbooks.Open Filename:="DIV F-SHIPPING.xls"
With Sheet1.PageSetup
.PrintArea = ("e10:ar83")
End With
Sheet1.PrintOut
ActiveWorkbook.Close False
Application.EnableEvents = True
End If

any Ideas? Thank you
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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