LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Run Event Code In General Module

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

ActiveCell.EntireRow.Interior.ColorIndex = 6

If z = Empty Then
ElseIf Not z = ActiveCell.Row Then
Rows(z).EntireRow.Interior.ColorIndex = xlColorIndexNone
End If

z = ActiveCell.Row

End Sub

I run this code with a worksheet. It is perfect. Can I put this code
(or new version) in a module so I can run it in any active sheet, any
active workbook?

Thanks

 
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
Declare a class module in General Declarations Wilbur[_8_] Excel Programming 1 March 12th 06 03:52 PM
WorkBook VS General Module Desert Piranha[_54_] Excel Programming 2 February 24th 06 03:41 AM
Where?Worksheet code module or Worksheet_SelectionChange event han Kenzie Excel Worksheet Functions 4 January 30th 06 09:41 PM
General ?? regarding Macro or Module size in a spreadsheet JohnG[_2_] Excel Programming 3 August 3rd 05 10:43 AM
General protection fault in module HPPCL5F4.DLL at 0002:000006c2. Ben Excel Discussion (Misc queries) 1 January 4th 05 12:05 AM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"