LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default how to call a sub that has arguments

Hi, I'm trying to call this procedure located in the MyCode module:
Sub Worksheet_Change(ByVal Target As Range)
code here
End Sub
(the above code works properly when it is in the Sheet1 (Budget) module)

From this procedure which is in the Sheet1 (Budget) module. How do I
write the code below? The best I can come up with is:
Sub YearChange()
Call MyCode.Worksheet_Change
End Sub

It does not work, I don't know how to handle the argument within the
parenthesis.

Also, I don't think I need to include the MyCode as part of the path,
but a similar Call procedure I've done without arguments only works if I
include this in the path. What might I have done wrong.

I would appreciate anyone's help with writing the bottom code correctly.

Gratefully,
Harold
 
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
Re : Excel To Call Sub and Assign Arguments [email protected] Excel Programming 6 September 11th 08 01:36 AM
call a macro with arguments in a Command Button Jeff Excel Programming 1 November 9th 06 07:35 PM
arguments gemini0662 Excel Discussion (Misc queries) 9 July 13th 06 03:48 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM


All times are GMT +1. The time now is 04:56 PM.

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"