bonjour à toutes et à tous,
j'ai un conflit dans cet ensemble qui ne fonctionne pas notamment
Private Sub CBT_Valider_Click() qui m'indique "erreur de compilation varaible non définie"
Option Explicit
Dim ws As Worksheet
Private Sub ComboBox1_Change()
Dim i As Integer
If Me.ComboBox1.ListIndex = -1 Then Exit Sub
With Me.ComboBox2
.Clear
For i = 2 To ws.Cells(Me.ComboBox1.Column(1), Columns.Count).End(xlToLeft).Column
.AddItem ws.Cells(Me.ComboBox1.Column(1), i)
Next i
End With
End Sub
Private Sub userform_initialize()
Dim j As Long
Set ws = Sheets("Renseignements")
With Me.ComboBox1
.ColumnCount = 2
.ColumnWidths = "-1;0"
For j = 1 To ws.Range("a" & Rows.Count).End(xlUp).Row
.AddItem ws.Range("a" & j)
.List(.ListCount - 1, 1) = j
Next j
End With
End Sub
Private Sub CBT_Valider_Click()
If VIS_1 Then
With Sheets("VIS1")
lig = .[A65536].End(xlUp).Row + 1
.Range("A" & lig).Value = ComboBox1.Value
.Range("B" & lig).Value = ComboBox2.Value
.Range("C" & lig).Value = CDate(TB_date.Value)
.Range("D" & lig).Value = TB_compte.Value
End With
'ElseIf
End If
End Sub
il s'agit d'un userform avec deux menus déroulants liés et d'un bouton qui transfère des données.
merci d'avance