Auto print comand

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Datsmart

Well-known Member
Joined
Jun 19, 2003
Messages
7,985
If you just want to print the active worksheet:
Code:
ActiveSheet.Printout
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Please reply to your thread instead of using PMs

Hi,
I have a large machine service record sheet. this sheet counts down days to the next scheduled service.
I wondered if it would be possible to auto print the items required and machine due for service. So I could come into the office each morning go to the printer and have the information on hard copy without checking the sheet.


This should be possible using event code. In what range are the day countdown values and what value should trigger printing. Presumably the count down is achieved with a formula.
 
Upvote 0

Stevie p

Board Regular
Joined
Mar 8, 2009
Messages
228
Yes simple formula today()-a manual added date. Format set to general. Would like it to print when cell =1 day.
 
Upvote 0

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
You can try this: right click the sheet tab, select View Code and paste in

Rich (BB code):
Private Sub Worksheet_Calculate()
Dim c As Range
For Each c In Range("D2:D200") 'modify the range to suit
    If c.Value = 1 Then
        Me.PrintOut
        Exit For
    End If
Next c
End Sub

Change the range in red to the range where the countdown days are.

This code will run automatically each time the sheet calculates. What I'm not sure of is whether a change in the system date will cause the sheet to recalculate.
 
Upvote 0

Forum statistics

Threads
1,191,691
Messages
5,988,110
Members
440,126
Latest member
duque00

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
Top