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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,876
Messages
6,127,482
Members
449,385
Latest member
KMGLarson

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