Auto print comand

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If you just want to print the active worksheet:
Code:
ActiveSheet.Printout
 
Upvote 0
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
Yes simple formula today()-a manual added date. Format set to general. Would like it to print when cell =1 day.
 
Upvote 0
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,214,392
Messages
6,119,257
Members
448,880
Latest member
aveternik

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