piga25
XLDnaute Barbatruc
Bonjour,
 
Est il possible de mettre le résultat de 5 optionbutton d'une même frame dans une seule celulle?
 
J'ai un choix de 5 possibilités sur une frame d'un Userform, et j'aimerai que le résultat soit affiché dans une seule cellule qui est située sur le n° de ligne correspondant (vlign) en colonne 49.
Je sais que cela est possible pour deux optionbutton mais pour plus je ne sait pas faire.😕
 
	
	
	
	
	
		
	
		
			
		
		
	
				
			Est il possible de mettre le résultat de 5 optionbutton d'une même frame dans une seule celulle?
J'ai un choix de 5 possibilités sur une frame d'un Userform, et j'aimerai que le résultat soit affiché dans une seule cellule qui est située sur le n° de ligne correspondant (vlign) en colonne 49.
Je sais que cela est possible pour deux optionbutton mais pour plus je ne sait pas faire.😕
		Code:
	
	
	Sub Transfert(vLign As Long)
Dim i As Byte
Dim a As Byte
With ActiveSheet
    .Unprotect
    .Cells(vLign, 1) = CLng(Label2)
    .Cells(vLign, 2) = UCase(TextBox1)
    .Cells(vLign, 3) = Application.Proper(TextBox2)
    .Cells(vLign, 4) = ComboBox1
    .Cells(vLign, 5) = Format(TextBox3, "0# ###")
    .Cells(vLign, 6) = UCase(TextBox4)
    .Cells(vLign, 7) = UCase(TextBox5)
    .Cells(vLign, 8) = Format(TextBox6, "0# ## ## ## ##")
    .Cells(vLign, 9) = Format(TextBox7, "0# ## ## ## ##")
    .Cells(vLign, 10) = Format(TextBox8, "0# ## ## ## ##")
    .Cells(vLign, 11) = Format(TextBox9, "0# ## ## ## ##")
    .Cells(vLign, 12) = TextBox10
    For i = 1 To 15
        If Controls("CheckBox" & i) Then .Cells(vLign, i + 12) = 1 Else: .Cells(vLign, i + 12) = ""
    Next
    .Cells(vLign, 28) = TextBox11
    For a = 16 To 30
        If Controls("CheckBox" & a) Then .Cells(vLign, a + 13) = 1 Else: .Cells(vLign, a + 13) = ""
    Next
    .Cells(vLign, 44) = Application.Proper(TextBox13)
    .Cells(vLign, 45) = ComboBox2
    .Cells(vLign, 46) = ComboBox3
    .Cells(vLign, 47) = ComboBox4
    .Cells(vLign, 48) = TextBox14
   [COLOR=red]With .Cells(vLign, 49)[/COLOR]
[COLOR=red]       Select Case OptionButton1[/COLOR]
[COLOR=red]       Case True[/COLOR]
[COLOR=red]       .Value = "1"[/COLOR]
[COLOR=red]       Case False[/COLOR]
[COLOR=red]       If OptionButton2 Then .Value = "2"[/COLOR]
[COLOR=red]       If OptionButton3 Then .Value = "3"[/COLOR]
[COLOR=red]       If OptionButton4 Then .Value = "4"[/COLOR]
[COLOR=red]       If OptionButton5 Then .Value = "5"[/COLOR]
[COLOR=red]       End Select[/COLOR]
[COLOR=red]   End With[/COLOR]
    
    Tri
    .Protect
End With
End Sub