Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default events doesnt work

Hi

In excel 2003, i try to use an event located in a worksheet, but it seems that no event works. For exemple, i put this code in sheet1 and i do not get any reaction when selecting a cell.

Private Sub Worksheet_SelectionChange(ByVal Target _
As Excel.Range)
Cells.Interior.ColorIndex = xlNone
With ActiveCell
.EntireRow.Interior.ColorIndex = 1
.EntireColumn.Interior.ColorIndex = 1
End With
End Sub


Only Auto_Open(and Close) events seem to work.

Is there something i did, wrong or do i need to add some reference?

Thanks a lot

Avi
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default events doesnt work

Hi,

Application.EnableEvents = False
Did you do something like that somewhere else in your codings?


If you did, just turn it on by including this small routine

Private Sub Worksheet_Activate()

Application.EnableEvents = True

End Sub


Hope it works.

Regards,

Faiz

"benitAAvi" wrote:

Hi

In excel 2003, i try to use an event located in a worksheet, but it seems that no event works. For exemple, i put this code in sheet1 and i do not get any reaction when selecting a cell.

Private Sub Worksheet_SelectionChange(ByVal Target _
As Excel.Range)
Cells.Interior.ColorIndex = xlNone
With ActiveCell
.EntireRow.Interior.ColorIndex = 1
.EntireColumn.Interior.ColorIndex = 1
End With
End Sub


Only Auto_Open(and Close) events seem to work.

Is there something i did, wrong or do i need to add some reference?

Thanks a lot

Avi

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default events doesnt work

If you did, just turn it on by including this small routine

Private Sub Worksheet_Activate()

Application.EnableEvents = True

End Sub


If EnableEvents is false, how do you expect this event to be
called?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Noor Faiz" wrote in message
...
Hi,

Application.EnableEvents = False
Did you do something like that somewhere else in your codings?


If you did, just turn it on by including this small routine

Private Sub Worksheet_Activate()

Application.EnableEvents = True

End Sub


Hope it works.

Regards,

Faiz

"benitAAvi" wrote:

Hi

In excel 2003, i try to use an event located in a worksheet,
but it seems that no event works. For exemple, i put this code
in sheet1 and i do not get any reaction when selecting a cell.

Private Sub Worksheet_SelectionChange(ByVal Target _
As Excel.Range)
Cells.Interior.ColorIndex = xlNone
With ActiveCell
.EntireRow.Interior.ColorIndex = 1
.EntireColumn.Interior.ColorIndex = 1
End With
End Sub


Only Auto_Open(and Close) events seem to work.

Is there something i did, wrong or do i need to add some
reference?

Thanks a lot

Avi



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
Why doesnt this work? MurrayBarn Excel Worksheet Functions 2 November 19th 09 04:21 PM
Why doesnt this work steve New Users to Excel 1 March 3rd 08 04:52 PM
TAB Key doesnt work. Murat D. Hekimošlu Excel Programming 1 January 25th 05 10:48 AM
code doesnt work Juan Pablo Gonzalez Excel Programming 1 April 23rd 04 09:51 PM
code doesnt work Juan Pablo Gonzalez Excel Programming 0 April 23rd 04 09:19 PM


All times are GMT +1. The time now is 04:46 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"