bonsoir,
dans les procédures événementielles ci-dessous j'ai deux éléments,
Un élément permattant de tester des valeurs
Un élément permettant de récupérer des couleurs dans une liste
et un élement permettant de mettre en place des combo dans les cellules d'une plage.
Les combo ne fonctionnent pas
pourquoi ?
merci
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Call Nbjoursup3
Application.EnableEvents = True
Application.EnableEvents = False
Call Nbjourpat
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Range("C3:BL65"), Target) Is Nothing Then
On Error Resume Next
Target.Interior.ColorIndex = [liste_code].Find(Target, LookAt:=xlWhole).Interior.ColorIndex
End If
Application.EnableEvents = True
Application.ScreenUpdating = False
ComboBox1.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
init
If Not Intersect(Target, [DQ4😀Q65]) Is Nothing Then
ComboBox1.Visible = True
ComboBox2.Visible = True
ComboBox3.Visible = True
ComboBox1.Left = Target.Left 'Offset(0, 1).
ComboBox2.Left = ComboBox1.Left + ComboBox1.Width
ComboBox3.Left = ComboBox2.Left + ComboBox2.Width
ComboBox1.Top = Target.Offset(0, 1).Top
ComboBox2.Top = ComboBox1.Top
ComboBox3.Top = ComboBox2.Top
End If
Application.ScreenUpdating = True
End Sub
Private Sub ComboBox1_Change()
TestCombo
End Sub
Private Sub ComboBox2_Change()
TestCombo
End Sub
Private Sub ComboBox3_Change()
TestCombo
End Sub
Sub TestCombo()
If ComboBox1.Value <> "" And ComboBox2.Value <> "" And ComboBox3.Value <> "" Then
ActiveCell = ComboBox1.Value & ":" & ComboBox2.Value & ":" & ComboBox3.Value
ComboBox1.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
End If
End Sub
Sub init()
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
For i = 0 To 23
ComboBox1.AddItem i
Next
For i = 0 To 59
ComboBox2.AddItem i
ComboBox3.AddItem i
Next
End Sub
dans les procédures événementielles ci-dessous j'ai deux éléments,
Un élément permattant de tester des valeurs
Un élément permettant de récupérer des couleurs dans une liste
et un élement permettant de mettre en place des combo dans les cellules d'une plage.
Les combo ne fonctionnent pas
pourquoi ?
merci
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Call Nbjoursup3
Application.EnableEvents = True
Application.EnableEvents = False
Call Nbjourpat
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Range("C3:BL65"), Target) Is Nothing Then
On Error Resume Next
Target.Interior.ColorIndex = [liste_code].Find(Target, LookAt:=xlWhole).Interior.ColorIndex
End If
Application.EnableEvents = True
Application.ScreenUpdating = False
ComboBox1.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
init
If Not Intersect(Target, [DQ4😀Q65]) Is Nothing Then
ComboBox1.Visible = True
ComboBox2.Visible = True
ComboBox3.Visible = True
ComboBox1.Left = Target.Left 'Offset(0, 1).
ComboBox2.Left = ComboBox1.Left + ComboBox1.Width
ComboBox3.Left = ComboBox2.Left + ComboBox2.Width
ComboBox1.Top = Target.Offset(0, 1).Top
ComboBox2.Top = ComboBox1.Top
ComboBox3.Top = ComboBox2.Top
End If
Application.ScreenUpdating = True
End Sub
Private Sub ComboBox1_Change()
TestCombo
End Sub
Private Sub ComboBox2_Change()
TestCombo
End Sub
Private Sub ComboBox3_Change()
TestCombo
End Sub
Sub TestCombo()
If ComboBox1.Value <> "" And ComboBox2.Value <> "" And ComboBox3.Value <> "" Then
ActiveCell = ComboBox1.Value & ":" & ComboBox2.Value & ":" & ComboBox3.Value
ComboBox1.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
End If
End Sub
Sub init()
ComboBox1.Clear
ComboBox2.Clear
ComboBox3.Clear
For i = 0 To 23
ComboBox1.AddItem i
Next
For i = 0 To 59
ComboBox2.AddItem i
ComboBox3.AddItem i
Next
End Sub