Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default program ok command button

Hi,

Trying to have a user form with 3 option buttons. user selects one option
then presses OK to continue running other macros.

3 Option buttons work ok

im having trouble with ok button to contine or end user form

Your help would be appreciated




Private Sub CommandButton1_Click()

End Sub

Private Sub OptionButton1_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "25"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub
Sub OptionButton2_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "26"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")




End Sub

Private Sub OptionButton3_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "27"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub

Private Sub UserForm_Click()



End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default program ok command button

hi
something like this might work.....
Private Sub CommandButton1_Click()
Call MyOtherMacro
End Sub

regards
FSt1

"Warren" wrote:

Hi,

Trying to have a user form with 3 option buttons. user selects one option
then presses OK to continue running other macros.

3 Option buttons work ok

im having trouble with ok button to contine or end user form

Your help would be appreciated




Private Sub CommandButton1_Click()

End Sub

Private Sub OptionButton1_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "25"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub
Sub OptionButton2_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "26"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")




End Sub

Private Sub OptionButton3_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "27"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub

Private Sub UserForm_Click()



End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default program ok command button

If you are experiencing problem with your OK Button Click Event you should
post it so we can see what the issue may be. If you are just wanting the
UserForm to Unload when the user is done then do this:

Private Sub CommandButton1_Click()

Unload Me

End Sub

Hope this helps!
--
Cheers,
Ryan


"Warren" wrote:

Hi,

Trying to have a user form with 3 option buttons. user selects one option
then presses OK to continue running other macros.

3 Option buttons work ok

im having trouble with ok button to contine or end user form

Your help would be appreciated




Private Sub CommandButton1_Click()

End Sub

Private Sub OptionButton1_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "25"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub
Sub OptionButton2_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "26"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")




End Sub

Private Sub OptionButton3_Click()

Sheets("Control").Select
ActiveSheet.Unprotect ("systemsBMCP")
Range("f11").Select
ActiveCell.FormulaR1C1 = "27"
Range("A1").Select
ActiveSheet.Protect ("systemsBMCP")


End Sub

Private Sub UserForm_Click()



End Sub

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
Hyperlink or Command Button Program Josh Johansen Excel Programming 0 June 19th 07 01:29 PM
Wanting to Create A Command Button Command bumper338 Excel Programming 3 May 7th 07 06:53 PM
VB's Command Button vs Form's Command Button Ronald Dodge Excel Programming 3 May 24th 06 02:23 PM
Another approach - Program Command Button EMoe[_57_] Excel Programming 2 October 5th 05 03:16 AM
running a command button from a program Pete at Sappi Fine Paper[_2_] Excel Programming 7 May 5th 05 03:08 PM


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