nitrammada
Board Regular
- Joined
- Oct 10, 2018
- Messages
- 78
- Office Version
- 365
- Platform
- Windows
Hi Everyone
I have some code that will FreezePanes at cell B7 perfectly, but I'm trying to run this on all of the veryhidden sheets where cell A1 = L2, without me having to open each one and then run the code.
Can any one tell me what I'm doing wrong please? My code is below.
Any direction or assistance is always appreciated.
Many thanks in advance.
Adam
I have some code that will FreezePanes at cell B7 perfectly, but I'm trying to run this on all of the veryhidden sheets where cell A1 = L2, without me having to open each one and then run the code.
Can any one tell me what I'm doing wrong please? My code is below.
VBA Code:
Sub FreezeL6()
'
' Apply Freeze at cell B7 to all sheets
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Range("A1") = "L2" Then
ActiveWindow.SmallScroll Down:=-1000
Range("B7:B7").Select
With Selection
ActiveWindow.FreezePanes = True
End With
End If
Next ws
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Any direction or assistance is always appreciated.
Many thanks in advance.
Adam