View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Convert Macro into an Add-in file

I think you're going to need an application event that'll look across workbooks.

But I don't think I'd do it. I'd use Chip Pearson's RowLiner addin.
http://www.cpearson.com/excel/RowLiner.htm

But if you want to try, you can read some very nice notes at Chip's site for
application events:

http://www.cpearson.com/excel/AppEvent.htm



DAA wrote:

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


--

Dave Peterson