Freeze Panes

D

Darin Kramer

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
 
J

John

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
 
P

paul.robinson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top