Is it possible ??

T

Trixie

Hi,

I've been watching and learning and utilizing some of the simpler VBA
code I've seen (you guys ROCK!), and was wondering how to incorporate
multiple Worksheet_Change subs in one sheet or if it's even possible?

For example I may have a sub that looks at a value and pops me a
msgbox, but also want to use a sub in the same worksheet that hides
rows..

I hope the question makes sense; I am a pretty green on VBA.

Thanks~
 
S

Sheeloo

You can not have multiple subs with the same name in the same scope...
so you can have only one Worksheet_Change sub for a give worksheet. You can
however call different subs (defined in standard modules, which do different
things) from the Worksheet_Change sub.
 
S

Simon Lloyd

If you mean you want the same sub to work on each sheet change event
then simplyput your code in the Thisworkbook module using this:


Code:
--------------------
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'YOUR CODE HERE
End Sub

--------------------


Trixie;390409 said:
Hi,

I've been watching and learning and utilizing some of the simpler VBA
code I've seen (you guys ROCK!), and was wondering how to incorporate
multiple Worksheet_Change subs in one sheet or if it's even possible?

For example I may have a sub that looks at a value and pops me a
msgbox, but also want to use a sub in the same worksheet that hides
rows..

I hope the question makes sense; I am a pretty green on VBA.

Thanks~


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
 
Top