ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   program ok command button (https://www.excelbanter.com/excel-programming/413279-program-ok-command-button.html)

warren

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

FSt1

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


RyanH

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



All times are GMT +1. The time now is 05:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com