Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all, thank you for your help.
Is it possible to launch the Sub Worksheet_Change Event from inside a macro? I tried this but It doesn´t work Sub Macro 1() Sub Worksheet_Change Event (rest of the code) end sub Thanks ! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rolo,
You can call the Worksheet_Change event procedure from another sub in a standard code module. First, change the Private keyword to Public, then call the sub with code like Sheet1.Worksheet_Change Range("A1") Change "Sheet1" to the VBA codename (not the worksheet name) of the appropriate sheet. A better, more structured, way is to put the code that currently resides in Worksheet_Change in another procedure in a standard code module and call that procedure. E.g,. [in a standard code module] Sub DoSomething (ByVal Target As Range) ' whatever End Sub [in the sheet module] Public Sub Worksheet_Change(ByVal Target As Excel.Range) DoSomething Target:=Target End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Rolo" wrote in message om... Hi all, thank you for your help. Is it possible to launch the Sub Worksheet_Change Event from inside a macro? I tried this but It doesn´t work Sub Macro 1() Sub Worksheet_Change Event (rest of the code) end sub Thanks ! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event Macro running another macro inside | Excel Discussion (Misc queries) | |||
Controling the Worksheet_Change Event? | Excel Discussion (Misc queries) | |||
Worksheet_Change Event - Macro kills copy and paste | Excel Programming | |||
Worksheet_Change event question | Excel Programming | |||
Worksheet_Change Event Not Working | Excel Programming |