jmenche
10-19-2005, 05:17 AM
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
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