Hey Excel Gurus,
I have a code which runs in every sheet. However I would like to bypass this code from two specific worksheets, namely "HSheet" and "Summary"
The code is as following.
Thanks and will appreciate...
I have a code which runs in every sheet. However I would like to bypass this code from two specific worksheets, namely "HSheet" and "Summary"
The code is as following.
VBA Code:
Private Sub Workbook_Sheetactivate(ByVal Sh As Object)
If Worksheets("HSheet").Range("B2") <> Selection.Column And Worksheets("HSheet").Range("B3") > 21 Then
Dim lCol As Long
Application.EnableEvents = 0
Application.ScreenUpdating = 0
With Sheets("HSheet")
lCol = .[B3]
End With
ActiveSheet.Cells(ActiveCell.Row, lCol).Select
ActiveWindow.ScrollColumn = Selection.Column
Application.EnableEvents = 1
Application.ScreenUpdating = 1
End If
End Sub
Thanks and will appreciate...