View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default FreezePanes is a window property

In message of Fri, 9 Dec 2016
13:43:20 in microsoft.public.excel.programming, Walter Briscoe
writes
In message of Fri, 9 Dec 2016 11:24:09 in
microsoft.public.excel.programming, Claus Busch <claus_busch@t-
online.de writes
Hi Walter,

Am Fri, 9 Dec 2016 10:02:06 +0000 schrieb Walter Briscoe:

With ActiveWindow
.SplitColumn = 1
.SplitRow = 1
.FreezePanes = True
End With


Can I simplify?


with SplitColumn =1 you freeze column A (1) and with
SplitRow=1 you freeze row 1. There is no need to select a cell.
Try for all sheets:

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
With ActiveWindow
.SplitColumn = 1
.SplitRow = 1
.FreezePanes = True
End With
End Sub

Thanks, Claus. I agree.
I don't know how I got it wrong. ;)


I now think I was right.
Set the window so the top left hand cell shows [8,1}
Transfer focus to a second sheet
Return to first sheet and Run
With ActiveWindow
.SplitColumn = 1
.SplitRow = 1
.FreezePanes = True
End With

SplitColumn and SplitRow are relative to what the window shows.
We want data relative to the Worksheet displayed in the Window.
--
Walter Briscoe