Private Sub quit_Click()
Unload rechercheview
End Sub
Private Sub UserForm_Initialize()
Dim Cell As Range
With Sheets("outillage")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBoutillage.AddItem (Cell)
Next
End With
With Sheets("sécurité")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBsecurite.AddItem (Cell)
Next
End With
With Sheets("consommable outillage")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBconso_outillage.AddItem (Cell)
Next
End With
With Sheets("consommable composite")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBconso_composite.AddItem (Cell)
Next
End With
With Sheets("tissus sec")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBtissus.AddItem (Cell)
Next
End With
With Sheets("prépreg")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBprepreg.AddItem (Cell)
Next
End With
With Sheets("résine")
For Each Cell In .Range("B2:B" & .Range("B65536").End(xlUp).Row)
Me.CBresine.AddItem (Cell)
Next
End With
End Sub
Private Sub save_click()
Dim resultat, R As Range
Dim ligne, occurence As Long
Set resultat = ThisWorkook.Sheets("sécurité").Range("B:B").Find(What:=CBsecurite.Value, lookln:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not resultat Is Nothing Then
MsgBox ("Recherche terminé")
occurence = 0
ligne = 2
With ThisWorkbook
For Each R In .Sheets("sécurité").Range("B1:B" & .Sheets("sécurité").Range("B:B").End(xlDown).Row)
If R.Value = CBsecurite.Value Then
If occurence = 0 Then
.Sheets("recherche").Range("B" & ligne).Value = .Sheets("sécurité").Range("B" & R.Row).Value
.Sheets("recherche").Range("C" & ligne).Value = .Sheets("sécurité").Range("A" & R.Row).Value
.Sheets("recherche").Range("D" & ligne).Value = .Sheets("sécurité").Range("C" & R.Row).Value
.Sheets("recherche").Range("E" & ligne).Value = .Sheets("sécurité").Range("E" & R.Row).Value
.Sheets("recherche").Range("F" & ligne).Value = .Sheets("sécurité").Range("H" & R.Row).Value
.Sheets("recherche").Range("G" & ligne).Value = .Sheets("sécurité").Range("A" & R.Row).Value
End If
End If
Next
End With
Else
MsgBox ("aucune information trouvée")
End If
Unload rechercheview
End Sub