ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Color change - Cell Pointer (https://www.excelbanter.com/excel-worksheet-functions/42361-color-change-cell-pointer.html)

Danny

Color change - Cell Pointer
 
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


All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com