P
Pat
The following macros freezes a sheet in different locations when either one
of two custom buttons on the toolbar is clicked.
Sub Freeze1()
ActiveWindow.FreezePanes = False
Application.GoTo Range("A29"), True
Range("D31").Select
ActiveWindow.FreezePanes = True
End Sub
and macro
Sub Freeze2()
ActiveWindow.FreezePanes = False
Columns("D
").Select
ActiveWindow.FreezePanes = True
Range("IV1").Select
End Sub
To allow other sheets within the workbook to use the custom button I have
included code within each sheet to allow this to happen. The code I am
using is not compiled correctly and an error occurs when the sheet is
activated. Here is the code being used:
Private Sub Worksheet_Activate()
With Application.CommandBars("Formatting")
With .Controls("Freeze1")
.Visible = True
End With
With .Controls("Freeze2")
.Visible = True
End With
End With
End Sub
Private Sub Worksheet_Deactivate()
With Application.CommandBars("Formatting")
With .Controls("Freeze1")
.Visible = False
End With
With .Controls("Freeze2")
.Visible = False
End With
End With
End Sub
Anyone know where the code is going wrong?
Appreciate any help
Pat
of two custom buttons on the toolbar is clicked.
Sub Freeze1()
ActiveWindow.FreezePanes = False
Application.GoTo Range("A29"), True
Range("D31").Select
ActiveWindow.FreezePanes = True
End Sub
and macro
Sub Freeze2()
ActiveWindow.FreezePanes = False
Columns("D

ActiveWindow.FreezePanes = True
Range("IV1").Select
End Sub
To allow other sheets within the workbook to use the custom button I have
included code within each sheet to allow this to happen. The code I am
using is not compiled correctly and an error occurs when the sheet is
activated. Here is the code being used:
Private Sub Worksheet_Activate()
With Application.CommandBars("Formatting")
With .Controls("Freeze1")
.Visible = True
End With
With .Controls("Freeze2")
.Visible = True
End With
End With
End Sub
Private Sub Worksheet_Deactivate()
With Application.CommandBars("Formatting")
With .Controls("Freeze1")
.Visible = False
End With
With .Controls("Freeze2")
.Visible = False
End With
End With
End Sub
Anyone know where the code is going wrong?
Appreciate any help
Pat