Exel formulas to change a cell once a print has been performed

imwitti

New Member
Joined
Apr 10, 2011
Messages
7
Is there a way in excel to change a cell dependent on a print having just been done eg

cell says "1" but after print butten is pushed cell now says "3"

Just wondering
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
You can use a Workbook_BeforePrint event:

Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Sheets("Sheet1").Range("A1")
    .Value = .Value + 2
End With
End Sub
 
Upvote 0
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
ActiveSheet.PrintOut
Sheet1.Range("A1") = 3
Application.EnableEvents = True
End Sub
Private Sub Workbook_Open()
Sheet1.Range("A1") = 1
End Sub

lenze
 
Upvote 0
Hey looks good but can you guys just explain your formulas to me?

Thanks

oh any reset after a period of time sounds intesting how is that done
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,486
Members
452,917
Latest member
MrsMSalt

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