Freeze Panes

S

sjm cpa

When I protect a worksheet in Excel 2007, the freeze pane option is not
available (grayed out). How can I make the option available without removing
worksheet protection?
 
G

Gord Dibben

I don't use 2007 but in 2003 you can freeze/unfreeze panes on a protected
worksheet.

You cannot freeze panes on a protected workbook.

If that is the case then use this macro.

Sub freeze()
ActiveWorkbook.Unprotect Password:="justme"
ActiveWindow.FreezePanes = False
Set srng = Application.InputBox(prompt:= _
"Select a cell", Type:=8)
srng.Select
ActiveWindow.FreezePanes = True
ActiveWorkbook.Protect Password:="justme", _
Structure:=True, Windows:=True
End Sub


Gord Dibben MS Excel MVP
 
S

sjm cpa

The workbook is not protected, just the worksheet page. From what I can
tell, this is new for 2007. Unprotecting the worksheet is not an option.
 
G

Gord Dibben

Maybe you don't understand what the macro does?

The code will unprotect only to allow the cell selection for Freeze Panes
then re-protect.

So it can be an option for that one operation.


Gord
 
S

sjm cpa

I am trying it out today. Thanks so much for your help, I haven't done macros
in a while.
 
S

sjm cpa

The macro works to allow the freeze panes. How does it undo the freeze panes
after the entries are completed?
 
G

Gord Dibben

Which entries would those be?

Just run another macro if you want to unfreeze panes after you're done with
whatever you're doing.

Sub un_freeze()
ActiveWorkbook.Unprotect Password:="justme"
ActiveWindow.FreezePanes = False
ActiveWorkbook.Protect Password:="justme", _
Structure:=True, Windows:=True
End Sub


Gord
 

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