Re : erreur d'execution sur fichier
bonjour,
Regarde ton code ci-dessous, tu as 2 fois "j1=recherchecolonne", enlève le 2ème et ça marche:
Private Sub ComboBox1_Change()
If ComboBox1.TopIndex = -1 And ComboBox1.Value <> "" Then
'creation
Exit Sub
End If
' affichage
TextBox1.Visible = True
TextBox2.Visible = True
i = ComboBox1.List(ComboBox1.ListIndex, 1)
Label2.Caption = Sheets(nomf1).Range(coldatderint & i)
Label3.Caption = Sheets(nomf1).Range(coldatpre & i)
Label4.Caption = Sheets(nomf1).Range(coltole & i)
TextBox1.Value = Date
'recherche de la prochaine
'ligne i
date1 = Date
j1 = recherchecolonne(nomf1, date1, lignedate, 8) ' recherche de la colonne
j1 = recherchecolonne(nomf1, "P", i, j1 + 1)
TextBox2.Value = Sheets(nomf1).Cells(1, j1)
' vérification de la date avec la plage pour l'intervention
If Date >= Sheets(nomf1).Range(coldatplustot & i) And Date <= Sheets(nomf1).Range(coldatplustard & i) Then
CommandButton2.Visible = True
Else
Call MsgBox("La maintenance de cette machine n'était pas à faire aujourd'hui.", vbCritical Or vbDefaultButton1, "Erreur")
End If
A+