Programmation vba

Résolu/Fermé
bibou72 Messages postés 5 Date d'inscription lundi 17 juin 2013 Statut Membre Dernière intervention 27 juin 2013 - Modifié par bibou72 le 27/06/2013 à 23:13
Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 - 27 juin 2013 à 23:37
Bonjour,
je cherche actuellement à créer un programme pour supprimer les doublons dans une base de données que j'ai reçu. Voici le début de mon programme:
Sub tableau()
Dim cellulecourante As Range
Dim cellulesuivante As Range
Set cellulecourante = ActiveSheet.Range(B3)
Selection.Sort Key1:=Range(B3), order1:=xlAscending, _
key2:=Range(C3), order2:=xlAscending, _
key3:=Range(D3), order3:=xlAscending, _
Header:=xlGuess, _
ordercustom:=1, matchcase:=false, orientation:=xltopbottom,
Do While Not IsEmpty(cellulecourante) = True
Set cellulesuivante = cellulecourante.Offset(1, 0)
If cellulesuivante.Value = cellulecourante.Value Then
If lignesidentiques(cellulecourante, cellulesuivante) = True Then
cellulecourante.EntireRow.Delete
End If
End If
Set cellulecourante = celluesuivante
Loop
End Sub

il semblerait que ce soit cette partie où il y a un problème:
Selection.Sort Key1:=Range(B3), order1:=xlAscending, _
key2:=Range(C3), order2:=xlAscending, _
key3:=Range(D3), order3:=xlAscending, _
Header:=xlGuess, _
ordercustom:=1, matchcase:=false, orientation:=xltopbottom,

le message d'erreur me dit: "attendu: paramètre nommé". J'ai beau chercher je ne trouve pas la solution. Merci d'avance pour vos réponses!

2 réponses

bibou72 Messages postés 5 Date d'inscription lundi 17 juin 2013 Statut Membre Dernière intervention 27 juin 2013
27 juin 2013 à 23:31
c'est bon j'ai trouvé l'erreur
0
Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 1 776
Modifié par Patrice33740 le 27/06/2013 à 23:37
Supprimes la virgule à la fin, après xltopbottom

Patrice
0