Excel macro

ealzind -  
Le Pingou Messages postés 12273 Date d'inscription   Statut Non membre Dernière intervention   -
Bonjour,

En fait j'ai écrit le code suivant dans Macro Excel (Windows 8) pour permuter les colonnes entre les lignes 38 et 72:
Sub etests()
For I = 38 To 72
Sub Permut(G As Integer, K As Integer)
Sub Permut(I As Integer, AO As Integer)
Sub Permut(K As Integer, AM As Integer)
Sub Permut(M As Integer, O As Integer)
Sub Permut(O As Integer, U As Integer)
Sub Permut(Q As Integer, G As Integer)
Sub Permut(S As Integer, AG As Integer)
Sub Permut(U As Integer, W As Integer)
Sub Permut(W As Integer, AI As Integer)
Sub Permut(Y As Integer, AC As Integer)
Sub Permut(AA As Integer, AU As Integer)
Sub Permut(AC As Integer, AK As Integer)
Sub Permut(AE As Integer, AS As Integer)
Sub Permut(AG As Integer, AQ As Integer)
Sub Permut(AI As Integer, Q As Integer)
Sub Permut(AK As Integer, S As Integer)
Sub Permut(AM As Integer, AW As Integer)
Sub Permut(AO As Integer, AA As Integer)
Sub Permut(AQ As Integer, Y As Integer)
Sub Permut(AS As Integer, AE As Integer)
Sub Permut(AU As Integer, M As Integer)
Sub Permut(AW As Integer, I As Integer)

End Sub
Else
Exit Sub

J'ai toujours une erreur et je ne peux pas l'exécuter (Nom ambigu détecté) , et les deux lignes ou je dois permuter la colonne AS, sont en rouge. Je crois bien que macro confond la colonne AS avec la commande As... Que dois je faire pour que ca marche?
MErci d'avance
A voir également:

1 réponse

Le Pingou Messages postés 12273 Date d'inscription   Statut Non membre Dernière intervention   1 463
 
Bonjour,
Au passage,
Je crois bien que macro confond la colonne AS avec la commande
Ce n'est pas la macro qui confond les instructions mais plutôt celui qui la créé.
Manque instruction [Next] pour terminer la boucle [For], les 2 lignes à la fin [Else] et [Exit Sub] sont inutiles. Toutes les lignes qui commencent par [Sub...] supposent une macro et le nom [Permut] est un nom réservé de fonction (Renvoie le nombre de permutations pour un nombre d'objets donné, qui peuvent être sélectionnés à partir d'objets number)

0