Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pass a variable to a different sub
I have a 2 command buttons on a userform. cmbCalculate and cmbAddToQuote.
cmbCalculate has code that confirms all textboxes have data before calculating a price. cmbAddToQuote adds the price to a worksheet. How can I pass a variable value from cmbCalculate code to cmbAddToQuote code. Here is what I have for an example. I want to stop Sub cmbAddToQuote_Click() if the variable StopCode = True. IS this possible? Public Sub cmbCalculate_Click() Dim StopCode as Boolean If textbox1 = "" Then MsgBox "Try Again." StopCode = True Exit Sub End If End Sub Private Sub cmbAddToQuote_Click() Call cmbCalculate_Click If StopCode = True Then Exit Sub '.....additional code End Sub Thanks in Advance, Ryan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pass a Variable from one sub to another sub | Excel Programming | |||
Pass Variable to another Sub | Excel Programming | |||
pass a variable to activate | Excel Programming | |||
pass a variable to a public sub | Excel Programming | |||
Pass the variable into the sub function | Excel Programming |