Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
Hi,
Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
Kent,
there can only be one worksheet_change event procedure for each worksheet. -- Hope that helps. Vergel Adriano "klysell" wrote: Hi, Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
You cannot have two Worksheet_Change events. Rahter, the separate task
should be place within the same procedure, and IF-THEN blocks should be used to allow either, both, or none to run. Pflugs "klysell" wrote: Hi, Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
Is there any way to combine the two under one procedure?
-- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 "Vergel Adriano" wrote: Kent, there can only be one worksheet_change event procedure for each worksheet. -- Hope that helps. Vergel Adriano "klysell" wrote: Hi, Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
You can use Select, or If statements to call a different sub procedure
depending on certain conditions.. but they have to be under just one worksheet_change event procedure.. for example: Private Sub Worksheet_Change(ByVal Target As Range) Select Case Target.Address Case "$A$1": MsgBox "execute a sub procedure" Case "$A$2": MsgBox "execute a different sub procedure" End Select End Sub -- Hope that helps. Vergel Adriano "Vergel Adriano" wrote: Kent, there can only be one worksheet_change event procedure for each worksheet. -- Hope that helps. Vergel Adriano "klysell" wrote: Hi, Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I have two worksheet_change events in same worksheet?
Thanks all.
-- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 "Pflugs" wrote: You cannot have two Worksheet_Change events. Rahter, the separate task should be place within the same procedure, and IF-THEN blocks should be used to allow either, both, or none to run. Pflugs "klysell" wrote: Hi, Can I have two worksheet_change procedures within the same worksheet code window? If so, how do I differentiate between the two procedures without there being a conflict? Upon enacting one of the worksheet_change events, I have the message that there has been an ambiguous naming conflict in my code. Thanks, -- Kent Lysell Financial Consultant Ottawa, Ontario W: 613.948-9557 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
worksheet_change can reference excel range on other worksheet | Excel Programming | |||
Handling Worksheet Events of a Worksheet Created During Runtime. | Excel Programming | |||
Call Worksheet_Change macro in another worksheet | Excel Programming | |||
Many Sub Worksheet_Change(ByVal Target As Range) In One Worksheet | Excel Programming |