View Custom View with Sheet Protection

G

Guest

I have excel running estimates for me. I have 3 diff prices which can be
picked from. I have this all set up. I want to lock the prices so noone can
change them. I also have custom views set up, so that instead of print 5
pages, you can print out only the information important to your estimate.
But when I lock the price cells, I can not access my custom views. Is there
a way to set this up diff, so I can still lock the cells i need locked and
view my custom views?

Thanks
John
 
G

Gord Dibben

John

You will have unprotect, change views then reprotect.

Best way to do this is with a macro.

Sub Change_View()
ActiveSheet.Unprotect Password:="justme"
ActiveWorkbook.CustomViews("my view").Show
ActiveSheet.Protect Password:="justme"
End Sub

If you are wanting to change views for printing, use this code in Thisworkbook.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.Unprotect Password:="justme"
ActiveWorkbook.CustomViews("my view").Show
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.CustomViews("other view").Show
ActiveSheet.Protect Password:="justme"
End Sub


Gord Dibben MS Excel MVP
 

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

Similar Threads

Custom views and formulas 1
Custom Views 2
Using Custom Views 3
Workbook protection 1
How to tell if a cell is protected 4
drop down list selection 1
Views are too easy to change 1
Lock view settings in OL2007? 3

Top