LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Passing a range between two subroutines.


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
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
VBA - passing Variables to subroutines Madduck Excel Discussion (Misc queries) 12 September 19th 08 03:20 AM
Calling subroutines and passing variables matpj[_55_] Excel Programming 1 March 29th 06 04:22 PM
Calling subroutines and passing variables matpj[_56_] Excel Programming 0 March 29th 06 03:55 PM
Passing a Range Jerry Excel Programming 4 February 14th 05 10:52 AM
passing range to c# Jerry Excel Programming 0 January 29th 05 08:29 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"