bonjour,
J'ai un petit souci avec un code. Il permet de remplir et classer des valeurs dans un tableau. Mais lorsqu'on lui demande de faire le quotient de la colonne G/H, il bugge lorsqu'une des valeurs est à zéro. Et c'est normal, mais alors comment contourner cet état.
la partie du code en question
'quotient
For i = 1 To UBound(Tbl, 1)
Tbl(i, 8) = CDbl(Tbl(i, 6) / Tbl(i, 7))
Next i
Range("B3").Resize(UBound(Tbl, 1), UBound(Tbl, 2)) = Tbl
DerL = Range("B65536").End(xlUp).Row
For Each Cel In Range("J3:J" & DerL)
Range("B" & Cel.Row).Interior.Color = Cel.Value
Next
DerL = Range("B65536").End(xlUp).Row 'tri couleur
Range("B3:J" & DerL).Sort Key1:=Range("J3"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Set MonDico = CreateObject("Scripting.Dictionary")
For Each Cel In Range("J3:J" & DerL)
If Not MonDico.Exists(Cel.Value) Then MonDico.Add Cel.Value, Cel.Value
Next
merci au fofo