Convert Macro into an Add-in file

D

DAA

I got the macro below from Mr. Bob Phillips in this
newsgroup. It changes the pointer color. I tried to
convert it into an ADD-in file so it will work whenever I
open a workbook. I tried to follow instructions to create
an Add-in file. I got as far as creating an (xla) file for
it but the macro won't work.

Your help is appreciated.

Public OldRng
Private Sub Workbook_Open()
ReDim OldRng(20) 'allow for up to 20 worksheets
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As
Object, ByVal Target As Range)
Dim ThisRng
On Error Resume Next
Set ThisRng = OldRng
If Not ThisRng Is Nothing Then
ThisRng.Interior.ColorIndex = xlNone
End If
Target.Interior.ColorIndex = 6 'yellow
Set OldRng = Target
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top