Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matt,
try passing it by reference to the called sub.. For example: Sub Main() Dim i As Integer i = 1 Increment i Debug.Print i End Sub Sub Increment(ByRef x As Integer) x = x + 1 End Sub -- Hope that helps. Vergel Adriano "Matt McQueen" wrote: I've a subroutine that calls another and passes a variable to it. However within the 'called' sub is a variable that I would like to pass back to the main sub. I know that this could be accomplished using module-level variables, but I'd like to know how to pass a variable 'backwards'. Cheers. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to set a userform's button caption equal to a variable in the main procedure? | Excel Programming | |||
How to elegantly end a main procedure from a userform command button? | Excel Programming | |||
How to get get variables to move from userform to main sub? | Excel Programming | |||
Pass switch to Main procedure | Excel Programming | |||
Passing CheckBox Value from Click Event to Main Macro | Excel Programming |