ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   more macro help - freeze panes (https://www.excelbanter.com/excel-discussion-misc-queries/204233-more-macro-help-freeze-panes.html)

mastersparky

more macro help - freeze panes
 
I have an excel 2003 spreadsheet with 215 identical pages - is there a macro
or formula to set the freeze pane function on all of them? The cell that
would need to be selected would be D6 on sheets1 to 215... Any help or
insight would be greatly appreciated

Thanks

mastersparky



Rick Rothstein

more macro help - freeze panes
 
Assuming this is a continuation of your previous question and the worksheets
you want this are all named SheetX (where X is a number from 1 to 215), then
this macro will do what you want...

Sub FreezePanes()
Dim X As Long
On Error GoTo CleanUp
For X = 1 To 215
Application.ScreenUpdating = False
Worksheets("Sheet" & X).Activate
With ActiveWindow
.SplitRow = 6
.SplitColumn = 4
' Omit the next line if you want to Split
' the Panes rather than to Freeze the Panes
.FreezePanes = True
End With
Next
CleanUp:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"mastersparky" wrote in message
...
I have an excel 2003 spreadsheet with 215 identical pages - is there a
macro
or formula to set the freeze pane function on all of them? The cell that
would need to be selected would be D6 on sheets1 to 215... Any help or
insight would be greatly appreciated

Thanks

mastersparky




mastersparky

more macro help - freeze panes
 
Your assuption was correct :)

Thanks again very much - the macro worked great!!!

"Rick Rothstein" wrote:

Assuming this is a continuation of your previous question and the worksheets
you want this are all named SheetX (where X is a number from 1 to 215), then
this macro will do what you want...

Sub FreezePanes()
Dim X As Long
On Error GoTo CleanUp
For X = 1 To 215
Application.ScreenUpdating = False
Worksheets("Sheet" & X).Activate
With ActiveWindow
.SplitRow = 6
.SplitColumn = 4
' Omit the next line if you want to Split
' the Panes rather than to Freeze the Panes
.FreezePanes = True
End With
Next
CleanUp:
Application.ScreenUpdating = True
End Sub

--
Rick (MVP - Excel)


"mastersparky" wrote in message
...
I have an excel 2003 spreadsheet with 215 identical pages - is there a
macro
or formula to set the freeze pane function on all of them? The cell that
would need to be selected would be D6 on sheets1 to 215... Any help or
insight would be greatly appreciated

Thanks

mastersparky





Dave Peterson

more macro help - freeze panes
 
Option Explicit
Sub testme()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
wks.Select
wks.Range("a1").Select 'so A1 is visible in the top left
wks.Range("d16").Select
ActiveWindow.FreezePanes = True
Next wks
End Sub




mastersparky wrote:

I have an excel 2003 spreadsheet with 215 identical pages - is there a macro
or formula to set the freeze pane function on all of them? The cell that
would need to be selected would be D6 on sheets1 to 215... Any help or
insight would be greatly appreciated

Thanks

mastersparky


--

Dave Peterson

ShaneDevenshire

more macro help - freeze panes
 
Hi,

Might as well throw my variation into the mix:

Sub FreezePanes()
Dim sh As Worksheet
For Each sh In Worksheets
sh.Activate
[D6].Select
ActiveWindow.FreezePanes = True
Next sh
End Sub

--
Thanks,
Shane Devenshire


"mastersparky" wrote:

I have an excel 2003 spreadsheet with 215 identical pages - is there a macro
or formula to set the freeze pane function on all of them? The cell that
would need to be selected would be D6 on sheets1 to 215... Any help or
insight would be greatly appreciated

Thanks

mastersparky




All times are GMT +1. The time now is 02:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com