Thread: [Solved] Return Freeze panes location
View Single Post
 
Old 09-18-2018, 02:14 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Simpler:
Code:
Sub Freeze_Panes() 'button click macro to freeze panes at row 4 and col A or Col H
With ActiveWindow
  .SplitRow = 3
  If .SplitColumn = 7 Then
    .SplitColumn = 0
    ActiveSheet.Shapes("FP").TextFrame.Characters.Text = "Freeze" & vbCr & "Pane"
  Else
    .SplitColumn = 7
    ActiveSheet.Shapes("FP").TextFrame.Characters.Text = "Un-Freeze" & vbCr & "Pane"
  End If
  .FreezePanes = True
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote