Masquage
bonjour
voila u bout de code qui me permet de masquer des questions dans un usf2( il y a 11 questions ) je peux cocher des cellulles qui se trouve dans les colonnes qui vont de 78 a 88 . j'ai coller le code dans usf 3( il ya 19 question) et je dois cocher dans les cellulles qui se trouvent de la colonnes 128 a 146 . j'ai modifier quelque valeurs mais cela ne fonctionne pas dans usf 3
merci
Private Sub ComboBox3_Change()
Dim Col As Integer
Dim Groupe As String, SousGroupe As String
Dim Ctrl As Control
If Encours = True Then Exit Sub
Nettoyage
' Début essai masquage Frame
For Each Ctrl In Me.Controls
If TypeOf Ctrl Is MSForms.Frame Then Ctrl.Visible = True
Next Ctrl
' Fin essai masquage Frame
With Sheets("Circulations Horizontales")
derligne = .Range("C" & Rows.Count).End(xlUp).Row
For I = 6 To derligne
If ComboBox3.Value <> "" Then
TextBox1.Value = ""
If .Range("A" & I) = ComboBox1.Value And .Range("B" & I) = ComboBox2.Value And .Range("C" & I) = ComboBox3.Value Then
'If .Range("C" & I) = ComboBox3.Value Then
TextBox1 = .Range("D" & I)
' Début essai masquage Frame
For Col = 78 To 88
If .Cells(I, Col) = "X" Then
Me.Controls("Frame" & Col - 77).Visible = False
For Each Ctrl In Me.Controls
If Left(Ctrl.Name, 7) = "Frame" & Format(Col - 77, "00") Then Ctrl.Visible = False
Next Ctrl
End If
Next Col
' Fin essai masquage Frame
For Col = 5 To 59
If .Cells(I, Col) <> "" Then
Groupe = Format(1 + ((Col - 5) \ 5), "00")
SousGroupe = Format(.Cells(I, Col) + (10 * (1 + ((Col - 5) Mod 5))), "000")
'Debug.Print "OptionButton" & Groupe & SousGroupe
Me.Controls("OptionButton" & Groupe & SousGroupe) = True
End If
Next Col
Me.TextBox2 = .Cells(I, 60)
I = derligne
End If
Else
TextBox1.Value = ""
End If
Next I
End With
End Sub
Bonjour
Crdlt