IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

end if en trop ?


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Inscrit en
    Juillet 2007
    Messages
    502
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 502
    Par défaut end if en trop ?
    bonsoir
    dans le code si dessous , lors de la phase de debugage j'ai le message suivant
    "un End if sans bloc IF"
    ET je trouve pas ou ??????????????????

    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
     
    If UserForm3.CheckBox7.Value = True Then
     
         Dim premcol As Long
         Dim dercol As Long
         Dim dercolnonvide As Long
     
         premcol = 7
     
       For indexfiltre9ligne = 2 To Sheets(UserForm3.ComboBox1.Text).UsedRange.Rows.Count 
            If Sheets(UserForm3.ComboBox1.Text).Range("a" & indexfiltre9ligne).Value = Sheets("résultat").Range("A" & INDEXCOURSEFILTREligne).Value Then 
                       dercolnonvide = Sheets(UserForm3.ComboBox1.Text).Range("G" & indexfiltre9ligne).End(xlToRight).Column 
                       If UserForm3.TextBox20.Value = 0 And UserForm3.TextBox18.Value = 0 Then dercol = dercolnonvide                       ElseIf UserForm3.TextBox18 > 0 And UserForm3.TextBox20.Value = 0 Then
                          dercol = dercolnonvide And premcol = dercolnonvide - UserForm3.TextBox18.Value
                          Else
                          dercol = dercolnonvide - UserForm3.TextBox20.Value 
                       End If
     
                       If UserForm3.TextBox19.Value = 0 Then premcol = 7 Else premcol = 7 + UserForm3.TextBox19.Value
     
                       'MsgBox (Sheets(UserForm3.ComboBox1.Text).Range("G" & dercol))
                       For indexfiltre9 = premcol To dercol  'Sheets(UserForm3.ComboBox1.Text).Range("G" & dercol) 
                           'MsgBox ("la num de la combi=" & Res(combinaisonN°, InK) & "comparez" & Sheets(UserForm3.ComboBox1.Text).Cells(indexfiltre9ligne, indexfiltre9) = Res(combinaisonN°, InK))
                           If Sheets(UserForm3.ComboBox1.Text).Cells(indexfiltre9ligne, indexfiltre9) = Res(combinaisonN°, InK) Then chxeliminer = chxeliminer + 1 
     
                       Next indexfiltre9
     
            End If
       Next indexfiltre9ligne
     
     
       End If 'verif checkbox7 tr

  2. #2
    Inactif  

    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    4 555
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 4 555
    Par défaut
    Bonjour,

    ton code réécrit, sans préjudice ni examen de ce qu'il fait :

    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
    If UserForm3.CheckBox7.Value = True Then
        Dim premcol As Long
        Dim dercol As Long
        Dim dercolnonvide As Long
        premcol = 7
        For indexfiltre9ligne = 2 To Sheets(UserForm3.ComboBox1.Text).UsedRange.Rows.Count
          If Sheets(UserForm3.ComboBox1.Text).Range("a" & indexfiltre9ligne).Value = Sheets("résultat").Range("A" & INDEXCOURSEFILTREligne).Value Then
            dercolnonvide = Sheets(UserForm3.ComboBox1.Text).Range("G" & indexfiltre9ligne).End(xlToRight).Column
            If UserForm3.TextBox20.Value = 0 And UserForm3.TextBox18.Value = 0 Then
              dercol = dercolnonvide
            ElseIf UserForm3.TextBox18 > 0 And UserForm3.TextBox20.Value = 0 Then
              dercol = dercolnonvide And premcol = dercolnonvide - UserForm3.TextBox18.Value
            Else
              dercol = dercolnonvide - UserForm3.TextBox20.Value
            End If
            If UserForm3.TextBox19.Value = 0 Then premcol = 7 Else premcol = 7 + UserForm3.TextBox19.Value
            'MsgBox (Sheets(UserForm3.ComboBox1.Text).Range("G" & dercol))
            For indexfiltre9 = premcol To dercol  'Sheets(UserForm3.ComboBox1.Text).Range("G" & dercol)
              'MsgBox ("la num de la combi=" & Res(combinaisonN°, InK) & "comparez" & Sheets(UserForm3.ComboBox1.Text).Cells(indexfiltre9ligne, indexfiltre9) = Res(combinaisonN°, InK))
              If Sheets(UserForm3.ComboBox1.Text).Cells(indexfiltre9ligne, indexfiltre9) = Res(combinaisonN°, InK) Then chxeliminer = chxeliminer + 1
            Next indexfiltre9
          End If
        Next indexfiltre9ligne
      End If 'verif checkbox7 tr

  3. #3
    Membre éclairé
    Inscrit en
    Juillet 2007
    Messages
    502
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 502
    Par défaut

    super merci
    un oeil exterieur est pertinent

    merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Front End graphique pour GDB sous windows
    Par KORTA dans le forum GDB
    Réponses: 8
    Dernier message: 20/08/2003, 09h52
  2. chaine trop longue pour envoyer en socket?
    Par jeje.r dans le forum C++Builder
    Réponses: 10
    Dernier message: 27/06/2003, 16h36
  3. Surface trop grande
    Par Black_Daimond dans le forum DirectX
    Réponses: 1
    Dernier message: 18/01/2003, 03h02
  4. Arrêter un prog si temps de connexion trop long
    Par jakouz dans le forum Langage
    Réponses: 4
    Dernier message: 22/10/2002, 18h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo