LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Panes sequence. Pane Index 2 & 3 depend on how panes are created


Hi guys,

I found following to be somewhat surprising, and it cost me several
hours before the coin dropped...

FYI & FWIW

The Panes.Collection does not always return the panes in the sequence:
1 2
3 4
when splits are set manually and the splitrow is set before the
splitcolumn...then and only then the sequence is different.
1 3
2 4

I'm sure MS$ will say it's by design. But I sure as hell would have
preferred if the panes collection's indexing was independent of the
sequence in which the panes are created.

Sub Demo()
With ActiveWindow
.FreezePanes = False: .SplitRow = 0: .SplitColumn = 0

'No manual splits
'Select FreezePanes
'Sequence is 1234

.VisibleRange.Cells(3, 4).Select
.FreezePanes = True
MsgPanes "FreezePanes only. (1234)"

'Manual splits

'SplitColumn is set BEFORE SplitRow
'Sequence is 1234
.SplitColumn = 3
.SplitRow = 2
MsgPanes "SplitColumn first (1234)"

'Manual: SplitRow is set BEFORE SplitColumn
'Sequence is 1324 !!!
.SplitRow = 2
.SplitColumn = 3
MsgPanes "SplitRow first (1324 !!!)"

End With
End Sub

Sub MsgPanes(sRemark$)
With ActiveWindow
MsgBox .Panes(1).VisibleRange.Address & vbLf & _
.Panes(2).VisibleRange.Address & vbLf & _
.Panes(3).VisibleRange.Address & vbLf & _
.Panes(4).VisibleRange.Address & vbLf, _
vbInformation, sRemark
.FreezePanes = False: .SplitRow = 0: .SplitColumn = 0
End With
End Sub

--
keepITcool

| www.XLsupport.com | keepITcool chello nl | amsterdam
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
the criteria pane and table panes have disappered. llewelwa Excel Worksheet Functions 0 March 22nd 10 01:25 PM
FREEZE PANES mjw Excel Discussion (Misc queries) 1 August 18th 09 05:30 PM
Freeze Panes Dave Excel Discussion (Misc queries) 5 May 27th 09 09:41 AM
How do I kill the Research pane, other task panes in Excel EllenB Setting up and Configuration of Excel 2 August 9th 06 10:44 PM
More Dividers for Excel Viewing Panes / multiple panes per axis. bIgJeNkS3 Excel Discussion (Misc queries) 1 August 2nd 06 11:51 PM


All times are GMT +1. The time now is 02:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"