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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks