Sub Photo()
'Chemin = ThisWorkbook.Path & "\"
' PID = Coul.Value & ".jpg"
' Direction = Dir(Chemin & PID)
' N_ph = Chemin & PID
' If Direction = "" Then
' PID = "inexistante.jpg" ' MODIF pour n'UTILISER QUE PID en VARIABLE
' N_ph = Chemin & PID
' End If
'Image1.Picture = LoadPicture(N_ph)
End Sub
donc modifier les codes
Private Sub Box2_Change()
K = Box2.ListIndex
If Box2.ListIndex > 0 Then
LgN = Lg
Set Prenom = Sheets("Data").Range("B" & LgN & ":B" & Rows.Count).SpecialCells(xlCellTypeConstants).Find(Box2.Value)
LgN = Prenom.Row
Mod1 = Sheets("Data").Cells(LgN, 3)
Prix = Sheets("Data").Cells(LgN, 4)
Dim Coul As String
Coul = Sheets("Data").Cells(LgN, 5)
Else
LgN = Lg
Mod1 = Sheets("Data").Cells(LgN, 3)
Prix = Sheets("Data").Cells(LgN, 4)
Coul = Sheets("Data").Cells(LgN, 5)
End If
'Coul = Sheets("Data").Cells(LgN, 5) = le prix de l'article ? FAUX
'Coul = Sheets("Data").Cells(LgN, 6) = le prix de l'article ? VRAIS
'Call Photo
'Call Photo Coul / Call est inutile
Photo Coul
End Sub
Sub Photo(Coul As String)
Chemin = ThisWorkbook.Path & "\"
PID = Coul.Value & ".jpg"
Direction = Dir(Chemin & PID)
N_ph = Chemin & PID
If Direction = "" Then
PID = "inexistante.jpg" ' MODIF pour n'UTILISER QUE PID en VARIABLE
N_ph = Chemin & PID
End If
Image1.Picture = LoadPicture(N_ph)
End Sub