Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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
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
worksheet_change can reference excel range on other worksheet Dreiding Excel Programming 2 August 3rd 07 09:38 PM
Handling Worksheet Events of a Worksheet Created During Runtime. chatterbox Excel Programming 1 April 25th 07 04:50 PM
Call Worksheet_Change macro in another worksheet Freddy Excel Programming 6 October 29th 06 07:16 PM
Many Sub Worksheet_Change(ByVal Target As Range) In One Worksheet MathewPBennett Excel Programming 4 December 24th 03 01:01 PM


All times are GMT +1. The time now is 09:13 PM.

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

About Us

"It's about Microsoft Excel"