Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The procedure must be in the worksheet module who events you are monitoring.
Right click the sheet tab and select 'view code'. It goes here -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you change single digits to recognized double digits? | Excel Worksheet Functions | |||
MsgBox in Enter event causes combobox not to run Change event | Excel Programming | |||
Change event and calculate event | Excel Programming | |||
change event/after update event?? | Excel Programming |