print from cell reference

kavanagh

Board Regular
Joined
Apr 1, 2009
Messages
155
I'm trying to make a worksheet print automatically.

When the cell E10 of worksheet dates-08-2-xls hits >=186 days
the other workbook diva.xls worksheet 15 A1. prints

how would i code this, any help would be greatly appreaciated

thank you k
 
To deal with multiple events try

Code:
Private Sub Worksheet_Calculate()
If Range("E10").Value >= 186 Then
    Application.EnableEvents = False
    Workbooks.Open Filename:="Diva.xls"
    Sheets(15).PrintOut
    ActiveWorkbook.Close False
    Application.EnableEvents = True
End If
If Range("E52").Value >= 186 Then
    Application.EnableEvents = False
    Workbooks.Open Filename:="Diva.xls"
    Sheets(16).PrintOut
    ActiveWorkbook.Close False
    Application.EnableEvents = True
End If
ElseIf Range("E94").Value >= 186 Then
    Application.EnableEvents = False
    Workbooks.Open Filename:="Diva.xls"
    Sheets(8).PrintOut
    ActiveWorkbook.Close False
    Application.EnableEvents = True
End If
End Sub
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I was a little premature with perfect it all works great but today a found a little problem with it .
it seems that when I use other macro buttons not related to it,
on that sheet it seems to envoke the calculate event and prints
but it stops my other macros from working. any thoughts .

appreaciated. K
 
Upvote 0
In your other macros you will need to disable events like this

Code:
Application.EnableEvents = False
'
'your code
'
Application.EnableEvents = True
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

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