Private Sub ComboBox2_Change()
Range("E10:E22").ClearContents
Range("I10:I22").ClearContents
Range("M10:M22").ClearContents
Col = 1
For f = 1 To 4
With Sheets(f)
Set marque = Sheets(f).Cells.Find(ComboBox1.Value, LookIn:=xlValues)
Set modele = Sheets(f).Cells.Find(ComboBox2.Value, LookIn:=xlValues)
If Not marque Is Nothing And Not modele Is Nothing Then
If marque.Address = modele.Address Then .Range(marque, marque.Offset(12, 0)).Copy Sheets("page per models").Cells(10, Col)
End If
Col = Col + 4
End With
Next
For Each Sh In ActiveSheet.Shapes
If Sh.Name Like "Picture*" Then Sh.delete
Next
With Application.FileSearch
.LookIn = "W:\" & ComboBox1.Value & "\" & ComboBox1.Value & " " & ComboBox2.Value & "\photo1"
.Filename = "*"
.Execute
If .FoundFiles.Count > 0 Then
Range("B25").Select
'ceci devrait permettre de prendre que la 1ere photo du dossier, à voir:
ActiveSheet.Pictures.Insert (.FoundFiles(1))
ActiveSheet.Shapes(num_dos + 3).Height = 150
End If
End With
With Application.FileSearch
.LookIn = "W:\" & ComboBox1.Value & "\" & ComboBox1.Value & " " & ComboBox2.Value & "\photo2"
.Filename = "*"
.Execute
If .FoundFiles.Count > 0 Then
Range("H25").Select
'ceci devrait permettre de prendre que la 1ere photo du dossier, à voir:
ActiveSheet.Pictures.Insert (.FoundFiles(1))
ActiveSheet.Shapes(num_dos + 4).Height = 150
End If
End With
With Application.FileSearch
.LookIn = "W:\" & ComboBox1.Value & "\" & ComboBox1.Value & " " & ComboBox2.Value & "\photo3"
.Filename = "*"
.Execute
If .FoundFiles.Count > 0 Then
Range("B41").Select
'ceci devrait permettre de prendre que la 1ere photo du dossier, à voir:
ActiveSheet.Pictures.Insert (.FoundFiles(1))
ActiveSheet.Shapes(num_dos + 5).Height = 150
End If
End With
With Application.FileSearch
.LookIn = "W:\" & ComboBox1.Value & "\" & ComboBox1.Value & " " & ComboBox2.Value & "\photo4"
.Filename = "*"
.Execute
If .FoundFiles.Count > 0 Then
Range("H41").Select
'ceci devrait permettre de prendre que la 1ere photo du dossier, à voir:
ActiveSheet.Pictures.Insert (.FoundFiles(1))
ActiveSheet.Shapes(num_dos + 6).Height = 150
End If
End With
End Sub