Auto Freeze Frame

  • Thread starter Thread starter miker1999
  • Start date Start date
M

miker1999

Hi,
I would like to put in some code that would automatically freeze th
first two rows of data when the user first starts up the file. I woul
like 3 out of the 5 sheets to do this?

Here is what I thought would work:

Private Sub Freeze_Frames()
ActiveWindow.SplitRow = 2
ActiveWindow.FreezePanes = True
End Sub

But, it does not. Maybe I am putting it in the wrong place. Wher
should I put this? I put it on the sheet (right click on shee
tab>source).

Help.

PS.. Is there any code to automatically turn on the AutoFilters fo
this shared workbook
 
Hello miker
Where should I put this? I put it on the sheet (right click o
sheet tab>source).

The place was not wrong. Just call that procedure fro
Worksheet_Activate event like this.


Code
-------------------

Private Sub Worksheet_Activate()
Call Freeze_Frames
If Not AutoFilterMode Then Cells.AutoFilter
End Sub

Private Sub Freeze_Frames()
ActiveWindow.SplitRow = 2
ActiveWindow.FreezePanes = True
End Sub
 
Back
Top