goldenvision
Board Regular
- Joined
- Jan 13, 2004
- Messages
- 234
I feel really daft asking this but how do I make my module available as a macro?
I am currently having to copy and paste the module code into each sheet to allow it to run.
Module below:
I am currently having to copy and paste the module code into each sheet to allow it to run.
Module below:
Code:
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rr
Static cc
If cc <> "" Then
With Columns(cc).Interior
.ColorIndex = xlNone
End With
With Rows(rr).Interior
.ColorIndex = xlNone
End With
End If
r = Selection.Row
c = Selection.Column
rr = r
cc = c
With Columns(c).Interior
.ColorIndex = 20
.Pattern = xlSolid
End With
With Rows(r).Interior
.ColorIndex = 20
.Pattern = xlSolid
End With
End Sub