Mark_online
10-27-2010, 08:38 AM
I have a sheet-specific triggered even procedure (actually it came from the certification training course) and I would like to implement it across all of my Excel workbooks. I'm also interested in knowing how to to this in general with things other than macros. Here is the triggered event procedure:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Row As Long
Dim Col As Long
Dim Rng1 As Range
Dim Rng2 As Range
Application.EnableEvents = False
Row = Target.Row
Col = Target.Column
Set Rng1 = Range(Cells(Row, 1), Cells(Row, Col))
Set Rng2 = Range(Cells(1, Col), Cells(Row, Col))
Cells.Interior.ColorIndex = 0
Rng1.Interior.ColorIndex = 6
Rng2.Interior.ColorIndex = 6
Application.EnableEvents = True
End Sub
I, and some colleagues would like to have that appear in all of our current and future Excel workbooks with an easy way to disable it if necessary. Thanks.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Row As Long
Dim Col As Long
Dim Rng1 As Range
Dim Rng2 As Range
Application.EnableEvents = False
Row = Target.Row
Col = Target.Column
Set Rng1 = Range(Cells(Row, 1), Cells(Row, Col))
Set Rng2 = Range(Cells(1, Col), Cells(Row, Col))
Cells.Interior.ColorIndex = 0
Rng1.Interior.ColorIndex = 6
Rng2.Interior.ColorIndex = 6
Application.EnableEvents = True
End Sub
I, and some colleagues would like to have that appear in all of our current and future Excel workbooks with an easy way to disable it if necessary. Thanks.