Bonjour à toutes et à tous,
J'ai un code vba me permettant de faire un tri sur des données (tri aléatoire en fonction d'un roulement) qui fonctionne très bien sous excel 2016, mais qui me pointe une erreur d'exécution 438 (propriété ou méthode non gérée par cet objet) sous excel 2013 (version qui va utiliser ce code...)
Il faut donc que je le réécrive, mais je ne sais pas comment.
Voici le code en question:
Je mets également le fichier en PJ; le code s'exécute lorsqu'on clique sur le bouton "REGENERER"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 Sub tri_alea() ' ' tri_alea Macro ' ' Sheets("DATA").Select Range("B2:B8").Select Selection.Copy Range("E2").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveWindow.SmallScroll Down:=0 Range("D2:E8").Select Application.CutCopyMode = False ActiveWorkbook.Worksheets("DATA").Sort.SortFields.Clear ActiveWorkbook.Worksheets("DATA").Sort.SortFields.Add2 Key:=Range _ ("E2:E8"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("DATA").Sort .SetRange Range("D2:E8") .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply Sheets("Affectations Saisie PY").Select Range("B2:E2").Select MsgBox ("Planning généré avec succès") End With Exit Sub End Sub
Merci pour votre aide
Partager