Salut Frisoo,
Salut njhub,
tri des ingrédients par colonne via VBA.
Un double-clic en 'BDD' classe les ingrédients en 'BDD1'
Attention à écrire chaque ingrédient Á L'IDENTIQUE !!
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim rCells As Range, rCel As Range, sCol$
'
Cancel = True
For Each rCel In UsedRange
rCel.Value = Application.WorksheetFunction.Proper(rCel.Value)
Next
Set rCells = UsedRange
With Worksheets("BDD1")
.Cells.Delete
For Each rCel In rCells
If rCel.Value <> "" Then
iCol = Asc(Left(Trim(rCel.Value), 1))
.Range(Chr(iCol) & .Range(Chr(iCol) & Rows.Count).End(xlUp).Row + 1).Value = rCel.Value
End If
Next
For x = 1 To 26
.Columns(x).RemoveDuplicates Columns:=1
sCol = Chr(64 + x)
If .Range(sCol & 2) <> "" Then _
.Range(sCol & "1:" & sCol & .Range(sCol & Rows.Count).End(xlUp).Row).Sort key1:=.Range(sCol & 1), order1:=xlAscending, Orientation:=xlByRows
Next
.Columns.AutoFit
.Activate
End With
'
End Sub
A+