Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default change event not recognized

I am running Excel 2003 under Windows XP, and I want to do some data
validation when a cell is changed in the worksheet. Using this example from
Visual Basic Help:

Private Sub Worksheet_Change(ByVal Target as Range)
Target.Font.ColorIndex = 5
End Sub

this Sub is never executed when any cell in the worksheet is changed. I
set a breakpoint in the sub, and it never triggered. Does the sub have to be
in some particular module, or do events have to be activated in some manner?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default change event not recognized

Did you put it in the sheet code module, not a standard code module?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"rebelxtuser" wrote in message
...
I am running Excel 2003 under Windows XP, and I want to do some data
validation when a cell is changed in the worksheet. Using this example

from
Visual Basic Help:

Private Sub Worksheet_Change(ByVal Target as Range)
Target.Font.ColorIndex = 5
End Sub

this Sub is never executed when any cell in the worksheet is changed. I
set a breakpoint in the sub, and it never triggered. Does the sub have to

be
in some particular module, or do events have to be activated in some

manner?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default change event not recognized

if your events have been disabled without being re-enabled then you will have
to re-enable them. Run this one litle bit of code and then try your
spreadsheet again

Sub ResetEvents()
application.enableevents = true
end sub

Whenever you are toggling application settings make sure that you reset them
and that you have error handling to catch the inevitable error that will come
up at some point in your life...
--
HTH...

Jim Thomlinson


"rebelxtuser" wrote:

I am running Excel 2003 under Windows XP, and I want to do some data
validation when a cell is changed in the worksheet. Using this example from
Visual Basic Help:

Private Sub Worksheet_Change(ByVal Target as Range)
Target.Font.ColorIndex = 5
End Sub

this Sub is never executed when any cell in the worksheet is changed. I
set a breakpoint in the sub, and it never triggered. Does the sub have to be
in some particular module, or do events have to be activated in some manner?

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 you change single digits to recognized double digits? Evil with a K[_2_] Excel Worksheet Functions 5 April 3rd 23 02:29 PM
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM


All times are GMT +1. The time now is 01:17 AM.

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"