1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Private Sub cboRestau_Change()
Dim i As Variant, j As Variant, k As Variant
Dim Plage As Range
NomCherche = cboRestau
i = Application.Match(NomCherche, Sheets("BD").Columns(4), 0)
k = Sheets("BD").Range("D65536").End(xlUp).Row
For a = 1 To k
If Sheets("BD").Cells(a, 4).Value = NomCherche Then
j = a
End If
Next
For l = i To j
If Sheets("BD").Cells(l, 1).Value = "Boisson" Then
m = Sheets("BD").Cells(l, 14).Value
If m <> "" Then
n = n & vbLf & Sheets("BD").Cells(l, 14).Value
o = o & vbLf & Format(Sheets("BD").Cells(l, 15).Value, "0.00%")
End If
q = l
End If
If Sheets("BD").Cells(l, 1).Value = "Nourriture" Then
r = Sheets("BD").Cells(l, 14).Value
If r <> "" Then
s = s & vbLf & Sheets("BD").Cells(l, 14).Value
t = t & vbLf & Format(Sheets("BD").Cells(l, 15).Value, "0.00%")
End If
u = l
End If
Next
p = i + Application.Match("Boisson", Sheets("BD").Range("A" & i & ":A" & j), 0) - 1
v = i + Application.Match("Nourriture", Sheets("BD").Range("A" & i & ":A" & j), 0) - 1
txtAffichFamille = n
txtAffichRatio = o
TextBox11 = Format(Application.WorksheetFunction.Average(Sheets("BD").Range("O" & p & ":O" & q)), "0.00%")
TextBox8 = s
TextBox10 = t
TextBox12 = Format(Application.WorksheetFunction.Average(Sheets("BD").Range("O" & v & ":O" & u)), "0.00%")
End Sub |
Partager