Y a t il un nombre limite de Module

Bonjour à tous,

je voulais juste savoir si il y a avait un nombre maximum de création de module ?

Car dans un fichier, j'ai créé 18 modules ( 1 par feuille) avec 2 macro par module sensiblement les même à part les conditions de tri.

Certain de mes modules dont je lance la macro ne fonctionne pas et me jette de mon fichier avec pour message le redémarrage du programme.

Si je supprime 2-3 modules, la même macro fonctionne (celle qui ne fonctionnait pas)!!!

Comment résoudre ce problème ?

Est ce vraiment le nombre important de module qui fait bugger mon fichier ?

Merci à vous par avance

Voici dans chaque module la macro que l'on peut trouver. a part les critères de sélection des info (dans les "If")

Dim DerLig As Long
Dim test(23, 60000) As String
Dim Method(23, 60000) As String
Dim System(23, 60000) As String
Dim Country(23, 60000) As String
Dim Pool(23, 60000) As String
Dim PERIOD(23, 60000) As String
Dim LEVELNR(23, 60000) As String
Dim NR(23, 60000)
Dim MN(23, 60000)
Dim SD(23, 60000)
Dim CV(23, 60000)

Sub Extraction_QCP_AT_2()

Lignes = 60000
l = 1

ActiveSheet.Unprotect ("phl2855")

'lecture des données

For i = 2 To Lignes

    If Sheets("Export").Range("J" & i).Value = "Antithrmb." Then
        If Sheets("Export").Range("S" & i).Value = "3" Then
             If Sheets("Export").Range("L" & i).Value = "IL: AT Chromogenic" Then
                If Sheets("Export").Range("N" & i).Value = "IL: ACL Top  Family" Then
                    If Sheets("Export").Range("R" & i).Value <> "14" Then
                        If Sheets("Export").Range("R" & i).Value <> "15" Then

        With Sheets("Export")

                test(1, l) = .Range("J" & i).Value
                Method(2, l) = .Range("L" & i).Value
                System(3, l) = .Range("N" & i).Value
                Country(4, l) = .Range("O" & i).Value
                Pool(5, l) = .Range("P" & i).Value
                PERIOD(6, l) = .Range("R" & i).Value
                LEVELNR(7, l) = .Range("S" & i).Value
                NR(8, l) = .Range("T" & i).Value
                MN(9, l) = .Range("U" & i).Value
                SD(10, l) = .Range("V" & i).Value
                CV(11, l) = .Range("W" & i).Value

                    l = l + 1

            End With
                End If
                    End If
                        End If
                            End If
                                End If
                                    End If

    Next i

'Ecriture des données

With Sheets("QCP 2 AT")

    For i = 1 To l

        .Range("A" & i + 1).Value = test(1, i)
        .Range("B" & i + 1).Value = Method(2, i)
        .Range("C" & i + 1).Value = System(3, i)
        .Range("D" & i + 1).Value = Country(4, i)
        .Range("E" & i + 1).Value = Pool(5, i)
        .Range("F" & i + 1).Value = PERIOD(6, i)
        .Range("G" & i + 1).Value = LEVELNR(7, i)
        .Range("H" & i + 1).Value = NR(8, i)
        .Range("I" & i + 1).Value = MN(9, i)
        .Range("J" & i + 1).Value = SD(10, i)
        .Range("K" & i + 1).Value = CV(11, i)

    Next i

'Ecriture des Titres

.Range("A1048576").End(xlUp).Offset(1, 0) = "QCP LEVEL 2" + " " + Sheets("Export").Range("Z7")
DerLig = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A" & DerLig & ":K" & DerLig).Merge
.Range("A" & DerLig & ":K" & DerLig).HorizontalAlignment = xlCenter
.Range("A" & DerLig & ":K" & DerLig).Font.Color = 0
.Range("A" & DerLig & ":K" & DerLig).Font.Bold = True

.Range("B1048576").End(xlUp).Offset(2, 0) = "IL: AT Chromogenic "
.Range("C1048576").End(xlUp).Offset(2, 0) = "IL: ACL Top  Family"
.Range("F1048576").End(xlUp).Offset(3, 0) = "Nbre de Valeurs"
.Range("F1048576").End(xlUp).Offset(1, 0) = "Moyenne"
.Range("F1048576").End(xlUp).Offset(1, 0) = "ET"
.Range("F1048576").End(xlUp).Offset(1, 0) = "CV%"
.Range("F1048576").End(xlUp).Offset(1, 0) = "Nbre de Système"
.Range("F1048576").End(xlUp).Offset(2, 0) = "+2ET"
.Range("F1048576").End(xlUp).Offset(1, 0) = "+1ET"
.Range("F1048576").End(xlUp).Offset(1, 0) = "-1ET"
.Range("F1048576").End(xlUp).Offset(1, 0) = "-2ET"
.Range("F1048576").End(xlUp).Offset(1, 0) = "Biais Max"

'Ecriture des calculs

'Nbre de valeur

DerLig = .Range("G" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 3).FormulaR1C1 = "=SUM(R[-" & DerLig + 1 & "]C:R[-3]C)"

'Moyenne

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("I" & DerLig + 1).FormulaR1C1 = "=AVERAGE(R[-" & DerLig - 1 & "]C:R[-4]C)"
.Range("I" & DerLig + 1).NumberFormat = "0.00"

'Ecartype

DerLig = .Range("J" & Rows.Count).End(xlUp).Row
.Range("J" & DerLig + 5).FormulaR1C1 = "=STDEV(R[-" & DerLig + 3 & "]C[-1]:R[-5]C[-1])"
.Range("J" & DerLig + 5).NumberFormat = "0.00"

'CV%

DerLig = .Range("K" & Rows.Count).End(xlUp).Row
.Range("K" & DerLig + 6).FormulaR1C1 = "=R[-1]C[-1]/R[-2]C[-2]"
.Range("K" & DerLig + 6).Style = "Percent"
.Range("K" & DerLig + 6).NumberFormat = "0.00%"

'Nbre de Systeme

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 4).FormulaR1C1 = "=COUNTA(R[-" & DerLig + 2 & "]C[-1]:R[-7]C[-1])"'

'+2ET

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 2).FormulaR1C1 = "=R[-5]C[+1]+(2*R[-4]C[+2])"
.Range("H" & DerLig + 2).NumberFormat = "0.00"

'+1ET

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 1).FormulaR1C1 = "=R[-6]C[+1]+R[-5]C[+2]"
.Range("H" & DerLig + 1).NumberFormat = "0.00"

'-1ET

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 1).FormulaR1C1 = "=R[-7]C[+1]-R[-6]C[+2]"
.Range("H" & DerLig + 1).NumberFormat = "0.00"

'-2ET

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 1).FormulaR1C1 = "=R[-8]C[+1]-(2*R[-7]C[+2])"
.Range("H" & DerLig + 1).NumberFormat = "0.00"

'Biais Max

DerLig = .Range("H" & Rows.Count).End(xlUp).Row
.Range("H" & DerLig + 1).FormulaR1C1 = "=2.8*R[-7]C[+3]"
.Range("H" & DerLig + 1).NumberFormat = "0.00%"

'Format

DerLig = .Range("F" & Rows.Count).End(xlUp).Row
.Range("F" & DerLig - 10 & ":K" & DerLig - 6).Font.Bold = True
.Range("F" & DerLig - 10 & ":K" & DerLig - 6).Interior.Color = 5660672
.Range("F" & DerLig - 10 & ":K" & DerLig - 6).Font.Color = RGB(255, 255, 255)

'Masquer lignes

DerLig = .Range("A" & Rows.Count).End(xlUp).Row
.Range("A2" & ":A" & DerLig - 1).EntireRow.Hidden = True

End With

ActiveSheet.Protect ("phl2855")

End Sub

Sub Sup_QCP_AT_2()

  Dim DerLig As Long

  With Sheets("QCP 2 AT")

    .Unprotect ("phl2855")

    DerLig = .Range("A" & Rows.Count).End(xlUp).Row
    .Range("A2" & ":A" & DerLig - 1).EntireRow.Hidden = False
    .Range("A2:XFD1048576").Delete

   .Protect ("phl2855")

  End With
End Sub

Bonjour CedthCed,

Merci d'éditer ton 1er post et de mettre le code entre balises [code][ /code] sans espace entre [ et /

Ce n'est pas un problème de nombre de modules, tu es très loin en deçà du maximum :roll:

Je pencherais plutôt pour un problème de développement

Sans fichier, difficile de savoir

A+

Bon c'est pas du côté des modules.

Je vais regarder dans les macros même.

Peux tu m'expliquer l'histoire des crochets à mettre. j'ai pas compris!!

Re,

CedthCed a écrit :

Peux tu m'expliquer l'histoire des crochets à mettre. j'ai pas compris!!

En haut tu as un bouton spécial pour ça (voir ci-dessous)

Tu sélectionnes tout ton code et tu cliques sur le bouton, tu devrais comprendre

screenshot082

Merci Bruno.

Je continu à regarder pour ma macro si je ne trouve pas la solution je posterai mon fichier

Rechercher des sujets similaires à "nombre limite module"