Warning that can be created when more than 1 worksheet is selected

D

Dooley

I am having an issue with other employees in my company highlighting all the
worksheets in a workbook to print.

They are not ungrouping after they have printed, and then someone else comes
along and makes changes to cells in one sheet... and it changes all of those
cells in each worksheet because they are still grouped.

Does anyone know of a way to not allow worksheet grouping, or a way to have
a warning when all the sheets are grouped, or any other way to dipose of this
problem?
 
B

Bernard Liengme

If you add this to the workbook module (NOT a general or sheet module), then
any grouping will be undone by selecting the first worksheet. The users can
be shown how to print the entire workbook with the Entire Workbook option in
the print dialog. Come back if you need help putting the module in the right
place - what version of Excel?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets(1).Select
End Sub

best wishes
 
D

Dooley

Bernard,

I am not sure about this. Is this VB code that should be used in the
"Developer" tab? I am using Office/ Excel 2007

I think I need a little more direction as to where to paste this.

Thanks
 
B

Bernard Liengme

Here we go:
1) We need to get to the VB Editor. If you have Developer tab on the Ribbon
open it and on the far left click the Visual Basic tool OR use ALT+F11.
2) In the VBEditor on the left side is the project window. Let's say your
Excel file is called CompanyData; locate the project entry
"VBA(CompanyData)" and DOUBLE click its "ThisWorkbook" entry.
3) Copy and Paste the code into the module window (the large open space)

Ok so that task is done. One more step. Since it is Excel 2007 you must do a
SaveAs and specify Macro-enabled workbook. The file will save with a XLSM
extension where M denotes a macro-enabled file.

OK?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top