Sub test()
'
Dim nb&, C1&, C2&, Cx1, Cx2, Px1, Px2, Px3 ' Retypage des Px
nb = 20
Cells(1, 1).Resize(nb, 2).Clear
C1 = vbRed: Cx1 = longToRGB(C1)
C2 = vbBlue: Cx2 = longToRGB(C2)
Px1 = -(Cx1(1) - Cx2(1)) / (nb - 1)
Px2 = -(Cx1(2) - Cx2(2)) / (nb - 1)
Px3 = -(Cx1(3) - Cx2(3)) / (nb - 1)
For i = 0 To nb - 1
Cells(i + 1, 1).Interior.Color = RGB(Round(Cx1(1) + i * Px1), Round(Cx1(2) + i * Px2), Round(Cx1(3) + i * Px3))
Cells(i + 1, 3) = Round(Cx1(1) + i * Px1)
Cells(i + 1, 4) = Round(Cx1(2) + i * Px2)
Cells(i + 1, 5) = Round(Cx1(3) + i * Px3)
Next i
Cells(1, 2).Interior.Color = C1
Cells(nb, 2).Interior.Color = C2
End Sub