Programmation vba
Résolu
bibou72
Messages postés
5
Statut
Membre
-
Patrice33740 Messages postés 8930 Statut Membre -
Patrice33740 Messages postés 8930 Statut Membre -
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!
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!
A voir également:
- Programmation vba
- Application de programmation - Guide
- Excel compter cellule couleur sans vba - Guide
- Incompatibilité de type vba ✓ - Forum VB / VBA
- Vba ouvrir un fichier excel avec chemin ✓ - Forum VB / VBA
- Vba récupérer valeur cellule ✓ - Forum VB / VBA