Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert Macro into an Add-in file
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I use macro in Excel 2007 to convert to and email PDF file | Excel Worksheet Functions | |||
convert email address file in Excel 2000 to Word file with commas | Excel Discussion (Misc queries) | |||
How do I convert an excel file into a comma separated values file | Excel Discussion (Misc queries) | |||
How do I convert excel file into ASCII text file with alignment? | Excel Discussion (Misc queries) | |||
Excel Macro To Convert XML File | Excel Programming |