Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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
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
#N/A Replacement Susana C via OfficeKB.com Excel Discussion (Misc queries) 2 December 29th 06 05:06 PM
MsgBox Replacement w/ an UserForm Chuckles123[_35_] Excel Programming 1 October 10th 04 01:40 PM
MsgBox Replacement w/ an UserForm Chuckles123[_34_] Excel Programming 2 October 9th 04 05:48 PM
MsgBox Replacement w/ an UserForm Chuckles123[_32_] Excel Programming 1 October 9th 04 03:59 PM
MsgBox Replacement w/ an UserForm Chuckles123[_31_] Excel Programming 0 October 9th 04 02:38 PM


All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"