RE:Option Butts

Carlos Rivera

New Member
Joined
Aug 16, 2007
Messages
45
RE:Option Butts

John hello!!, Are you there? I'm sending the codes about the option buttons, I made them to work!! here is the code, what opinion does it deserve?

Code:

Private Sub CommandButton1_Click()

End Sub

Private Sub cmdCancelar_Click()
Dim Resp As Integer
Resp = MsgBox("Seguro que desea cancelar?", vbQuestion + vbYesNo, "Cancelar")
If Resp = vbYes Then
Unload Me
End If
End Sub

Private Sub cmdGuardar_Click()
If Val(txtNumeroAngulo.Text) < 0 Or Val(txtNumeroAngulo.Text) > 180 Then
MsgBox "Numero Angulo No Valido"
txtNumeroAngulo.SetFocus
Exit Sub
End If
Worksheets("Sheet1").Activate
Range("C28").Select

If Range("C28").Value = "" Then
Range("C28").Activate

Else
Worksheets("Sheet1").Activate
Range("G28").Select

If Range("G28").Value = "" Then
Range("G28").Activate
End If
End If
With ActiveCell
.Value = txtNumeroAngulo.Text
End With

With ActiveCell
.BorderAround Weight:=xlThin, ColorIndex:=1
End With

With ActiveCell.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

'Set cell 4 columns right of activecell to blank, no border, no color
If Range("C28") Then
With ActiveCell.Offset(, 4)
.Value = ""
.Borders.LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
End If

'Set cell 4 columns left of activecell to blank, no border, no color
If Range("G28") Then
With ActiveCell.Offset(, -4)
.Value = ""
.Borders.LineStyle = xlNone
.Interior.ColorIndex = xlNone
End With
End If
Unload Me
End Sub

Private Sub UserForm_Click()

End Sub
_____________________________
Carlos
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Glad you got it to work for you.

I misunderstood your request. I thought you wanted to change the button colors, not the cell themselves.

Anyway, good work.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top