-
Solved: Make Workbook level event local
Howdy,
I was given this code for help on a workbook where every sheet had the same structure. I want to use this sub in another workbook where it is only needed in one sheet. Is there a way to localize this?
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Row = 7 And Target.Column >= 2 And Target.Column <= 4 Then
Sh.Range("A7:E49").Sort Key1:=Target.Cells(1, 1), Order1:=xlAscending, Header:=xlYes
End If
End Sub
-
Indeed there is...
In the project explorer, select the sheet you want to control and add the code to the Worksheet_SelectionChange event
K :-)
-
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules