This is possible with the use of VBA.
After you insert the OptionButton1, OptionButton2, and OptionButton3 radio buttons. The following code can be inserted into the form:
Private Sub UserForm_Initialize()
OptionButton1 = False
OptionButton2 = False
OptionButton3 = False
End Sub
Private Sub OptionButton1_Change()
TextBox1.Locked = False
TextBox1.Visible = True
Label1.Visible = True
TextBox2.Locked = True
TextBox2.Visible = False
Label2.Visible = False
TextBox3.Locked = True
TextBox3.Visible = False
Label3.Visible = False
End Sub
Private Sub OptionButton2_Change()
TextBox2.Locked = False
TextBox2.Visible = True
Label2.Visible = True
TextBox1.Locked = True
TextBox1.Visible = False
Label1.Visible = False
TextBox3.Locked = True
TextBox3.Visible = False
Label3.Visible = False
End Sub
Private Sub OptionButton3_Change()
TextBox3.Locked = False
TextBox3.Visible = True
Label3.Visible = True
TextBox2.Locked = True
TextBox2.Visible = False
Label2.Visible = False
TextBox1.Locked = True
TextBox1.Visible = False
Label1.Visible = False
End Sub
The form has 3 Labels, 3 Textboxes, and 3 OptionButtons, as in the following image:
EDIT:
Toblockthecellwiththeoptionbuttonontheworksheet,eachmacromustbeassignedtoeachradiobutton.
SubBotãodeopção1_Clique()Worksheets("Planilha1").Range("B1").Locked = False
Worksheets("Planilha1").Range("B2").Locked = True
Worksheets("Planilha1").Range("B3").Locked = True
End Sub
Sub Botãodeopção2_Clique()
Worksheets("Planilha1").Range("B1").Locked = True
Worksheets("Planilha1").Range("B2").Locked = False
Worksheets("Planilha1").Range("B3").Locked = True
End Sub
Sub Botãodeopção3_Clique()
Worksheets("Planilha1").Range("B1").Locked = True
Worksheets("Planilha1").Range("B2").Locked = True
Worksheets("Planilha1").Range("B3").Locked = False
End Sub
EDIT2:
Using an ActiveX Control Combination Box and changing the ListFillRange
property to the data location, use this code:
Private Sub ComboBox1_Change()
'Declarar Planilha
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Planilha1")
If ComboBox1.Value = 1 Then
With ws
.Unprotect Password:="SuaSenha"
.Cells.Locked = False
.Cells.FormulaHidden = False
Range("B2").Locked = True
Range("B2").Value = 0
Range("B3").Locked = True
Range("B3").Value = 0
.Protect Password:="SuaSenha"
End With
ElseIf ComboBox1.Value = 2 Then
With ws
.Unprotect Password:="SuaSenha"
.Cells.Locked = False
.Cells.FormulaHidden = False
Range("B1").Locked = True
Range("B1").Value = 0
Range("B3").Locked = True
Range("B3").Value = 0
.Protect Password:="SuaSenha"
End With
ElseIf ComboBox1.Value = 3 Then
With ws
.Unprotect Password:="SuaSenha"
.Cells.Locked = False
.Cells.FormulaHidden = False
Range("B1").Locked = True
Range("B1").Value = 0
Range("B2").Locked = True
Range("B2").Value = 0
.Protect Password:="SuaSenha"
End With
End If
End Sub
Lock the desired cells depending on the value entered in the ComboBox.