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: 295
Default Passing a value to another macro

How do I pass a value from one macro to another? For example (simplified code)

sub aa()
mynum = 12
Application.Run "bb" ' pass the value of mynum to "bb"
' get the value of myvalue back from "bb"
'do some other stuff in "aa"
end Sub
----------------------------
Sub bb()
counter = 1
do while counter <= mynum
' code to execute in loop
counter = counter + 1
loop
myvalue = 66 ' pass the value of myvalue back to "aa"
end sub

Any help much appreciated, thanks, Brett


 
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
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
Passing Variables to another macro Jeff Excel Programming 3 January 16th 05 03:41 AM
Passing variables from Outlook Macro to Excel Macro [email protected] Excel Programming 2 January 7th 05 10:07 PM
Passing Solver a Macro TarrynG Excel Programming 0 September 28th 04 03:43 PM
passing variables from an excel macro to a powerpoint macro jake Excel Programming 1 December 11th 03 02:36 AM


All times are GMT +1. The time now is 06:56 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"