ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with BeforePrint (https://www.excelbanter.com/excel-programming/279173-help-beforeprint.html)

Eric[_7_]

Help with BeforePrint
 
I have a slight problem I am hoping the guru's can help me
with.

Currently, I have a sheet that has a button that
calculates a few cells when pressed. I would like the
button to be Visible = False but after it has been
printed, bring the button back. The code I have is:

Private Sub Workbook_BeforePrint(Cancel As Boolean)

If Sheets(13) Is ActiveSheet Then
Sheets(13).Shapes("CommandButton1").Visible = False
Else: End If

End Sub

I can't bring the button back into the above procedure,
becuase when it hits End Sub, but button will be visible
and end up on the hard copy. Any ideas how I can bring the
button back to Visible = True AFTER the above has ran?

dizzykid

Help with BeforePrint
 
Eric,

I'm no guru, but I think I know what you're after. You don't need any code
for this, just use the properties window to set the Visible property as True
and the .PrintObject property to False.
HTH,
Chris


"Eric" wrote in message
...
I have a slight problem I am hoping the guru's can help me
with.

Currently, I have a sheet that has a button that
calculates a few cells when pressed. I would like the
button to be Visible = False but after it has been
printed, bring the button back. The code I have is:

Private Sub Workbook_BeforePrint(Cancel As Boolean)

If Sheets(13) Is ActiveSheet Then
Sheets(13).Shapes("CommandButton1").Visible = False
Else: End If

End Sub

I can't bring the button back into the above procedure,
becuase when it hits End Sub, but button will be visible
and end up on the hard copy. Any ideas how I can bring the
button back to Visible = True AFTER the above has ran?




Ron de Bruin

Help with BeforePrint
 
Hi Eric

In the properties of a button you can say if it must print or not

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Eric" wrote in message ...
I have a slight problem I am hoping the guru's can help me
with.

Currently, I have a sheet that has a button that
calculates a few cells when pressed. I would like the
button to be Visible = False but after it has been
printed, bring the button back. The code I have is:

Private Sub Workbook_BeforePrint(Cancel As Boolean)

If Sheets(13) Is ActiveSheet Then
Sheets(13).Shapes("CommandButton1").Visible = False
Else: End If

End Sub

I can't bring the button back into the above procedure,
becuase when it hits End Sub, but button will be visible
and end up on the hard copy. Any ideas how I can bring the
button back to Visible = True AFTER the above has ran?





All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com