Sub Bouton1_QuandClic()
Dim ws As Worksheet
Dim c As Range
Dim firstaddress As String
Dim nombre As Integer
Dim total As Double
Dim cherche As String
Dim cellules As Range
cherche = Sheets('feuil1').Range('a2')
For Each ws In Worksheets
'If ws.Name <> 'Feuil1' Then
With ws
Set c = .Cells.Find(cherche, LookIn:=xlValues)
If Not c Is Nothing Then
firstaddress = c.Address
Do
nombre = nombre + 1
If IsNumeric(c.Offset(1, 0)) Then
total = total + c.Offset(1, 0) 'c'est ici que tu dois jouer pour rechercher telle ou telle cellule, regarde dans l'aide
End If
Set c = .Cells.FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
' End If
Next ws
Select Case cherche
Case 'carottes'
Set cellules = Range('e2')
Case 'kiwi'
Set cellules = Range('e3')
'etc.... pour les autres légumes ou fruits
End Select
cellules = nombre - 2
cellules.Offset(0, 1) = total
End Sub