Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Replacement w/ an UserForm
Sub ShowForm() Dim Button As String frmPricing_Options_UserForm.Show If Button = "EVAL" Then Range("A1").Select Else Range("C1").Select End If End Sub Private Sub optEval_Prices_Click() Button = "EVAL" Unload Me End Sub Private Sub optBid_Prices_Click() Button = "BID" Unload Me End Sub When the macro is executed, Cell C1 is selected even when the EVA Option Button is clicked. Thanks again, Chuckles12 -- Chuckles12 ----------------------------------------------------------------------- Chuckles123's Profile: http://www.excelforum.com/member.php...fo&userid=1494 View this thread: http://www.excelforum.com/showthread.php?threadid=26787 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Replacement w/ an UserForm
Okay, that is easy.
Because you Don't declare the Button variable as a global variable, the option button routines are not setting the variable you think they are, but rather an implicit Form class variable called Button. In you standard code module, change the ShowForm code to this Public Button As String Sub ShowForm()frmPricing_Options_UserForm.Show If Button = "EVAL" Then Range("A1").Select Else Range("C1").Select End If End Sub -- HTH RP "Chuckles123" wrote in message ... Sub ShowForm() Dim Button As String frmPricing_Options_UserForm.Show If Button = "EVAL" Then Range("A1").Select Else Range("C1").Select End If End Sub Private Sub optEval_Prices_Click() Button = "EVAL" Unload Me End Sub Private Sub optBid_Prices_Click() Button = "BID" Unload Me End Sub When the macro is executed, Cell C1 is selected even when the EVAL Option Button is clicked. Thanks again, Chuckles123 -- Chuckles123 ------------------------------------------------------------------------ Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948 View this thread: http://www.excelforum.com/showthread...hreadid=267872 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
MsgBox Replacement w/ an UserForm
It seems you are setting Button="EVAL" in a Private Sub and trying to
use that in a general module Dimmed within a procedure. Try - Public Button As String - at the top of the general module. Mike F "Chuckles123" wrote in message ... Sub ShowForm() Dim Button As String frmPricing_Options_UserForm.Show If Button = "EVAL" Then Range("A1").Select Else Range("C1").Select End If End Sub Private Sub optEval_Prices_Click() Button = "EVAL" Unload Me End Sub Private Sub optBid_Prices_Click() Button = "BID" Unload Me End Sub When the macro is executed, Cell C1 is selected even when the EVAL Option Button is clicked. Thanks again, Chuckles123 -- Chuckles123 ------------------------------------------------------------------------ Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948 View this thread: http://www.excelforum.com/showthread...hreadid=267872 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
#N/A Replacement | Excel Discussion (Misc queries) | |||
MsgBox Replacement w/ an UserForm | Excel Programming | |||
MsgBox Replacement w/ an UserForm | Excel Programming | |||
MsgBox Replacement w/ an UserForm | Excel Programming | |||
MsgBox Replacement w/ an UserForm | Excel Programming |