ATTN: Mr. Bob Phillips

G

Guest

I got your macro command a long time ago to change the cell pointer. I pasted
it in "ThisWorkbook" on my Personal worksheet. The Macro works when you put
the code in a worksheet. Can you please modify the code so if I copy it in my
Personal worksheet, it will work everytime I open a new workbook?
Thanks a lot.

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
 
G

Guest

Hi Danny
Instead of pasting the Macro in "This Workbook"
put it in "All Open Workbooks"

HTH
Michael Mitchelson
 

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