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

I wanted to test data input on more than one cell. Trying to enter more than
one worksheet_change returns the "ambiguous name" error (same sub name). I
realize that I can do all my IF tests and code calls under the one
Worksheet_change event but it gets crowded.
Is it the only way ?

Thanks for any help and education.
jeffp
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Worksheet_change event multiple

You can only habe one worksheet_change event per worksheet. This is the only
way to do it. what you could do is split up the if..elseif..else...end if
from the actual implementation code - something like

Private Sub Worksheet_Change(ByVal Target As Range)

if target.column = 1 then
call DoStuffToColumn1(target)
elseif target.column = 2 then
call DoStuffToColumn2(target)
else
...do whatever
end if

End Sub

private function DoStuffToColumn1(Target as excel.range)
....write code here
end function

private function DoStuffToColumn2(Target as excel.range)
....write code here
end function


--
www.alignment-systems.com


"jeffP" wrote:

I wanted to test data input on more than one cell. Trying to enter more than
one worksheet_change returns the "ambiguous name" error (same sub name). I
realize that I can do all my IF tests and code calls under the one
Worksheet_change event but it gets crowded.
Is it the only way ?

Thanks for any help and education.
jeffp

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 event fires multiple times timconstan[_3_] Excel Programming 0 October 6th 04 03:59 PM
worksheet_change event fires multiple times timconstan[_2_] Excel Programming 1 October 5th 04 07:44 PM
worksheet_change event fires multiple times timconstan Excel Programming 1 October 5th 04 05:55 PM
worksheet_change event when multiple cells changed (pasted) noddy26 Excel Programming 13 July 24th 04 09:59 PM
Worksheet_Change Event cmcfalls[_4_] Excel Programming 3 April 12th 04 09:47 PM


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