ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Freeze Panes (https://www.excelbanter.com/excel-programming/372363-freeze-panes.html)

Darin Kramer

Freeze Panes
 
Hi,

Im looking for some VB to :

Select the sheet entitled Master.
Remove any Freeze panes formatting.
Goto cell b3, and freeze panes.

I tried using the basic macro recorder, but it doesnt seem to work...???

Any ideas...

Thanks

Darin

*** Sent via Developersdex http://www.developersdex.com ***

John[_88_]

Freeze Panes
 
Hello Darin,

Have a go with the code below (Note that FreezePanes is a property of the
Window object):

Sub SetPaneFreeze()
Dim wks As Worksheet

For Each wks In Application.ActiveWorkbook.Worksheets
If wks.Name = "Master" Then
wks.Select
ActiveWindow.FreezePanes = False
wks.Cells(3, 2).Select
ActiveWindow.FreezePanes = True
Exit For
End If
Next wks

End Sub

Best regards

John


"Darin Kramer" wrote in message
...
Hi,

Im looking for some VB to :

Select the sheet entitled Master.
Remove any Freeze panes formatting.
Goto cell b3, and freeze panes.

I tried using the basic macro recorder, but it doesnt seem to work...???

Any ideas...

Thanks

Darin

*** Sent via Developersdex http://www.developersdex.com ***




[email protected]

Freeze Panes
 
Hi Darin

Sub Freeze()
Application.ScreenUpdating = False
ActiveWorkbook.Worksheets("Master").Activate
ActiveWindow.FreezePanes = False
Worksheets("Master").Range("B3").Activate
ActiveWindow.FreezePanes = True
End Sub

regards
Paul

Darin Kramer wrote:
Hi,

Im looking for some VB to :

Select the sheet entitled Master.
Remove any Freeze panes formatting.
Goto cell b3, and freeze panes.

I tried using the basic macro recorder, but it doesnt seem to work...???

Any ideas...

Thanks

Darin

*** Sent via Developersdex http://www.developersdex.com ***




All times are GMT +1. The time now is 07:43 AM.

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