Re
Voici les deux codes pour rapatrier les points de partie 1 dans la feuille Inscription et effectuer le tri
1. importer les points de partie 1 dans la feuille Inscription
Sub Importation_points_Partie1()
Dim dlg As Byte
Application.ScreenUpdating = False
With Sheets("INSCRIPTIONS")
dlg = .Range("F" & Rows.Count).End(xlUp).Row
.Range("F6:G" & dlg).ClearContents
End With
With Sheets("PARTIE1")
dlg = .Range("C" & Rows.Count).End(xlUp).Row
.Cells(6, 3).Resize(dlg - 5, 2).Copy
Sheets("INSCRIPTIONS").Range("F6").PasteSpecial Paste:=xlPasteValues
End With
Call tri
Application.ScreenUpdating = True
End Sub
2 . Tri des données importées
Sub tri() 'trier PI dans feuille inscription
Dim dlg As Byte
With Sheets("INSCRIPTIONS")
dlg = .Range("F" & Rows.Count).End(xlUp).Row
.Range("F6:G" & dlg).Select
With .Sort
With .SortFields
.Clear
.Add2 Key:=Sheets("INSCRIPTIONS").Range("G6:G" & dlg), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
End With
.SetRange Sheets("INSCRIPTIONS").Range("F5:G" & dlg)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.Range("F6").Select
End With
End Sub
Rem :
- il est supposé que vous êtes positionné sur la feuille Inscription lorsque vous exécuter le code Importation
- il vous suffit d'associer un bouton au code Importation_points_partie1
- Sachez que l'on pourrait aussi ne prévoir qu'un seul code pour l'importation des données vers la feuille Inscription pour chacune des parties. Dans ce cas, il faudrait prévoir les bouton sur les feuilles Partie1 et Partie 2
Est il compliqué de bloquer la macro et afficher 1 message du style "CORRIGER LES ERREURS AVANT DE CONTINUER" si les cases de FORMULES (=SI; ) en colonne E affichent "ERREUR"
Dans quels cas avez-vous des erreurs ?
Quel est le code que vous voulez bloquer ? le Code qui génère la Partie1 ?
Sinon on pourrait oui. Mais d'abord avez-vous pensé à utiliser la fonction SIERREUR dans votre formule ? Ne serait-ce pas plus simpl