Macro pour effectuer un tri
voilier595
-
voilier595 -
voilier595 -
Bonjour à tous
Je rencontre un soucis avec un tri.
les lignes sont des variables
Voici mon code
'Traitement fichier sans volume (SV)
'Ouverture du fichier SV
Set wb = Workbooks.Open(CheminSV)
'Ligne d'entête (je cherche la ligne dont une cellule contient produit
Set A = Range("A:A").Find("Produit", lookat:=xlWhole)
LigEntSV = A.Row
'Derniére ligne SV
DerLigSV = Range("AB" & Rows.Count).End(xlUp).Row
'Suppression colonne C
Columns("C:C").Delete Shift:=xlToLeft
'Tri
Range("B" & LigEntSV & ":AB" & DerLigSV).Select
ActiveWorkbook.Worksheets("Expéditions Titrage").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Expéditions Titrage").Sort.SortFields.Add Key:= _
Range("B" & (LigEntSV + 1) & ":AB" & DerLigSV), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Expéditions Titrage").Sort
.SetRange Range("B" & LigEntSV & ":AB" & DerLigSV)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Mauvaise référence de tri en message d'erreur
Si je remplace les variables par les valeur chiffrées la macro fonctionne
Quelqu'un aurait-il une idée?
merci de votre aide
Je rencontre un soucis avec un tri.
les lignes sont des variables
Voici mon code
'Traitement fichier sans volume (SV)
'Ouverture du fichier SV
Set wb = Workbooks.Open(CheminSV)
'Ligne d'entête (je cherche la ligne dont une cellule contient produit
Set A = Range("A:A").Find("Produit", lookat:=xlWhole)
LigEntSV = A.Row
'Derniére ligne SV
DerLigSV = Range("AB" & Rows.Count).End(xlUp).Row
'Suppression colonne C
Columns("C:C").Delete Shift:=xlToLeft
'Tri
Range("B" & LigEntSV & ":AB" & DerLigSV).Select
ActiveWorkbook.Worksheets("Expéditions Titrage").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Expéditions Titrage").Sort.SortFields.Add Key:= _
Range("B" & (LigEntSV + 1) & ":AB" & DerLigSV), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Expéditions Titrage").Sort
.SetRange Range("B" & LigEntSV & ":AB" & DerLigSV)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Mauvaise référence de tri en message d'erreur
Si je remplace les variables par les valeur chiffrées la macro fonctionne
Quelqu'un aurait-il une idée?
merci de votre aide
A voir également:
- Macro pour effectuer un tri
- Vous devez disposer d'une autorisation pour effectuer cette action - Guide
- Comment faire un tri personnalisé sur excel - Guide
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Logiciel tri photo - Guide
- Jitbit macro recorder - Télécharger - Confidentialité