Color change - Cell Pointer

G

Guest

I got this macro to change the color of the cell pointer from this NG posted
by Mr. Bob Phillips long time ago. The macro works if its in the workbook.
Can it be modified so if you paste the macro in your Personal worksheet, it
will work on any workbook?

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

Thanks
 
D

dominicb

Good evening Danny

You could put the code in an add-in so that it is invoked every tim
you open Excel - that way it will be available in every worksheet yo
open and you won't get that message telling you that macros are presen
in a file.

Just note that as the code uses VBA every time a cell is changed, you
undo button becomes redundant - as long as you can live with that.

HTH

Dominic
 

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