User controlled Freeze Pane while protected
Not clear what type of protection and locking you have.
Worksheet protection does not disable Freeze Panes.
As long as users can select unlocked or locked cells they can freeze panes
anywhere they want.
Do you mean workbook protection is set?
If that's the case you would have to remove workbook protection before
unfreezing and re-freezing then re-protect.
Sub freeze_it()
With ActiveWorkbook
.Unprotect Password:="justme"
With ActiveWindow
.FreezePanes = False
Set pickcell = Application.InputBox(prompt:= _
"Select A Cell", Type:=8)
pickcell.Select
.FreezePanes = True
End With
.Protect Password:="justme", Structu=True, Windows:=True
End With
End Sub
Note: if users cannot select any cells due to sheet protection then you
would have to deal with also.
Gord Dibben MS Excel MVP
On Tue, 9 Feb 2010 14:33:02 -0800, FredL
wrote:
Hi,
I have a worksheet where it is protected and locked.
Is there anyway to code there such that the user (who cannot unlock the
sheet) can still use the freeze pane function so that they can determine how
to view the worksheet? I know you can enable the grouping via macro (e.g.
.EnableOutlining) while it is protected. Can the same be done for freeze
pane?
Thanks,
Fred
|