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
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