Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use macro in Excel 2007 to convert to and email PDF file rick5555 Excel Worksheet Functions 9 November 15th 13 04:39 PM
convert email address file in Excel 2000 to Word file with commas Mike A. Excel Discussion (Misc queries) 8 October 14th 08 02:48 PM
How do I convert an excel file into a comma separated values file Conquerer Excel Discussion (Misc queries) 3 August 17th 06 09:19 PM
How do I convert excel file into ASCII text file with alignment? Rosaiah Excel Discussion (Misc queries) 2 June 27th 05 12:17 PM
Excel Macro To Convert XML File John[_52_] Excel Programming 3 September 4th 03 05:34 PM


All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"