Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The workbook open occurs before the worksheet change will take affect. If you want to use the same code for both the worksheet open and a change event then create a new subroutine in the module and call the new routine from both the open and change events. You can pass a range to the new subroutine sub wokbook open set MyRange = Sheet("sheet1").range("A1") call common_sub(MyRange) end sub --------------------------------------- sub change event (target) call common_sub(target) end sub ----------------------------------------- new sub in a module sub common_sub(MyRange as Range) put common code here end sub -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=172761 Microsoft Office Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA - passing Variables to subroutines | Excel Discussion (Misc queries) | |||
Calling subroutines and passing variables | Excel Programming | |||
Calling subroutines and passing variables | Excel Programming | |||
Passing a Range | Excel Programming | |||
passing range to c# | Excel Programming |