Correction VBA

Fermé
Tito - 11 juin 2012 à 11:46
 GardienDeMoutons - 11 juin 2012 à 15:14
Bonjour, je fais un programme de VBA et que je n'arrive pas touver l'erreur. Pourriez-vous me corriger.
voilà
Private Sub Cmdliste_Click()
For i = 3 To 1300
If Worksheets("Liste").Cells(i, 1 + 10) = 0 Then
Worksheets("Liste").cells_activeworkbook.Colors(151) = RGB(127, 191, 255)

If Worksheets("Liste").Cells(i, 1 + 10) = 1 Then
Worksheets("Liste").cells_activeworkbook.Colors(11) = RGB(255, 127, 127)

If Worksheets("Liste").Cells(i, 1 + 10) = 2 Then
Worksheets("Liste").cells_activeworkbook.Colors(71) = RGB(191, 127, 255)

If Worksheets("Liste").Cells(i, 1 + 10) = 3 Then
Worksheets("Liste").cells_activeworkbook.Colors(51) = RGB(255, 255, 127)

If Worksheets("Liste").Cells(i, 1 + 10) = 4 Then
Worksheets("Liste").cells_activeworkbook.Colors(254) = RGB(204, 204, 204)

If Worksheets("Liste").Cells(i, 1 + 10) = 5 Then
Worksheets("Liste").cells_activeworkbook.Colors(31) = RGB(255, 191, 127)

If Worksheets("Liste").Cells(i, 1 + 10) = 6 Then
Worksheets("Liste").cells_activeworkbook.Colors(61) = RGB(223, 255, 127)

Else: Worksheets("Liste").Cells(i, 1 + 10) = ""
End If
Next i
Worksheets("Liste").Range("A3,AF1300").Sort
Key1: Worksheets("Liste").Range ("A3")
Sheets.Sort_ (1)

End Sub



2 réponses

f894009 Messages postés 17187 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 1 mai 2024 1 704
11 juin 2012 à 14:16
Bonjour,

question prealable:

.cells_activeworkbook.Colors(151) C'est quoi??????
0
GardienDeMoutons
11 juin 2012 à 15:14
et dans le même registre celui-là...????

Sheets.Sort_ (1)
0