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

Excel Discussion :

je voudrais faire les combinaison avec les elements d un tableau a deux dimension


Sujet :

Excel

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2013
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2013
    Messages : 3
    Points : 5
    Points
    5
    Par défaut je voudrais faire les combinaison avec les elements d un tableau a deux dimension
    voici le code pour un chaine de caractère


    Public Sub CreationChemin()
    Dim intI1 As Integer, intI2 As Integer, intI3 As Integer
    Dim intI4 As Integer, intI5 As Integer, intI6 As Integer, intN As Integer
    Dim strTab As String
    Dim sngChrono As Single
    strTab = UCase(InputBox("Saisissez les éléments : ", "Saisie", "ABCDEF"))
    sngChrono = Timer
    intI1 = 1
    Do Until Cells(1, intI1).Value = ""
    intI1 = intI1 + 1
    Loop
    Cells(1, intI1).Select
    intN = Len(strTab)
    ActiveCell.Value = strTab
    ActiveCell.Offset(1, 0).FormulaR1C1 = "=counta(R4C:R65536C)"
    ActiveCell.Offset(3, 0).Select
    For intI1 = 1 To intN
    For intI2 = 1 To intN
    If intI2 <> intI1 Then
    For intI3 = 1 To intN
    If intI3 <> intI1 And intI3 <> intI2 Then
    If Len(strTab) = 3 Then
    ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1)
    ActiveCell.Offset(1, 0).Select
    Else
    For intI4 = 1 To intN
    If intI4 <> intI1 And intI4 <> intI2 And intI4 <> intI3 Then
    If Len(strTab) > 4 Then
    For intI5 = 1 To intN
    If intI5 <> intI1 And intI5 <> intI2 And intI5 <> intI3 And intI5 <> intI4 Then
    If Len(strTab) > 5 Then
    For intI6 = 1 To intN
    If intI6 <> intI1 And intI6 <> intI2 And intI6 <> intI3 And intI6 <> intI4 And intI6 <> intI5 Then
    ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1) & Mid(strTab, intI5, 1) & Mid(strTab, intI6, 1)
    ActiveCell.Offset(1, 0).Select
    End If
    Next
    Else
    ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1) & Mid(strTab, intI5, 1)
    ActiveCell.Offset(1, 0).Select
    End If
    End If
    Next
    Else
    ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1)
    ActiveCell.Offset(1, 0).Select
    End If
    End If
    Next
    End If
    End If
    Next
    End If
    Next
    Next
    Cells(3, ActiveCell.Column).Value = (Timer - sngChrono)
    End Sub

    aide pour un tableau a deux dimension merci

  2. #2
    Expert éminent sénior Avatar de Menhir
    Homme Profil pro
    Ingénieur
    Inscrit en
    Juin 2007
    Messages
    16 037
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2007
    Messages : 16 037
    Points : 32 866
    Points
    32 866
    Par défaut
    Tu balances un code sans explications et tu ne précises pas sur quoi porte ta demande.
    Je doute que tu ais une réponse en faisant si peu d'efforts.

  3. #3
    Expert éminent

    Homme Profil pro
    Curieux
    Inscrit en
    Juillet 2012
    Messages
    5 136
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Curieux
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2012
    Messages : 5 136
    Points : 9 970
    Points
    9 970
    Billets dans le blog
    5
    Par défaut
    Bonjour,

    ça donnerait presque envie de mettre en place un générateur de ticket de pré-réponse, directement piloté par Excel
    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
    Function Reponse(Description As String)
    ' on hésite pas à ajouter des arguments !
    ' FichierDansSujet as Boolean
    ' PasCourtois as Boolean
    ' PasCourageux as Boolean
    ' etc...
     
    Select Case Description
     
        Case "Absente"
            Reponse = """ """
     
        Case "Imprécise"
            Reponse = "parfois à côté de la plaque"
     
        Case "Mal Formulée"
            Reponse = "potentiellement trouvée, mais avec du temps perdu"
     
        Case "Sans Code"
            Reponse = "si la boule de cristal des membres fonctionne, ils trouveront peut être la solution"
        ' ici ajoutez ce que j'oublie !
    End Select
     
    End Function
     
     
    Sub Alea()
    MsgBox "La réponse pour ce sujet sera : " & Reponse("Absente")
    End Sub
    Blague à part, un petit effort de présentation du code, de description du problème et de ce que tu n'arrives pas à faire.
    ça mange pas de pain et ça encourage à t'aider

  4. #4
    Expert éminent sénior
    Avatar de Marc-L
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Avril 2013
    Messages
    9 468
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2013
    Messages : 9 468
    Points : 18 674
    Points
    18 674
    Par défaut



    Bonjour,

    et poster dans le bon forum serait tellement plus judicieux ‼

    Important : Editorial - A lire avant de poster



    _____________________________________________________________________________________________________
    Je suis Charlie - Je suis Bardo

  5. #5
    Futur Membre du Club
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2013
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2013
    Messages : 3
    Points : 5
    Points
    5
    Par défaut comprehension
    le code la dessus fait la combinaison possible d une chaine de caractere.................alors moi je voulais que mon programme fasse la combinaison possible des elements d un tableau dans excel et non une chaine de caractere d ou je demande votre aide

  6. #6
    Expert éminent

    Homme Profil pro
    Curieux
    Inscrit en
    Juillet 2012
    Messages
    5 136
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Curieux
    Secteur : Arts - Culture

    Informations forums :
    Inscription : Juillet 2012
    Messages : 5 136
    Points : 9 970
    Points
    9 970
    Billets dans le blog
    5
    Par défaut
    Bonjour,

    la seule chose que je peux faire c'est ça

    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
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    Public Sub CreationChemin()
     Dim intI1 As Integer, intI2 As Integer, intI3 As Integer
     Dim intI4 As Integer, intI5 As Integer, intI6 As Integer, intN As Integer
     Dim strTab As String
     Dim sngChrono As Single
     
     strTab = UCase(InputBox("Saisissez les éléments : ", "Saisie", "ABCDEF"))
     sngChrono = Timer
     intI1 = 1
     
     Do Until Cells(1, intI1).Value = ""
        intI1 = intI1 + 1
     Loop
     
     Cells(1, intI1).Select
     intN = Len(strTab)
     ActiveCell.Value = strTab
     ActiveCell.Offset(1, 0).FormulaR1C1 = "=counta(R4C:R65536C)"
     ActiveCell.Offset(3, 0).Select
     
     For intI1 = 1 To intN
        For intI2 = 1 To intN
            If intI2 <> intI1 Then
                For intI3 = 1 To intN
                    If intI3 <> intI1 And intI3 <> intI2 Then
                        If Len(strTab) = 3 Then
                            ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1)
                            ActiveCell.Offset(1, 0).Select
                        Else
                            For intI4 = 1 To intN
                                If intI4 <> intI1 And intI4 <> intI2 And intI4 <> intI3 Then
                                    If Len(strTab) > 4 Then
                                        For intI5 = 1 To intN
                                            If intI5 <> intI1 And intI5 <> intI2 And intI5 <> intI3 And intI5 <> intI4 Then
                                                If Len(strTab) > 5 Then
                                                    For intI6 = 1 To intN
                                                        If intI6 <> intI1 And intI6 <> intI2 And intI6 <> intI3 And intI6 <> intI4 And intI6 <> intI5 Then
                                                            ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1) & Mid(strTab, intI5, 1) & Mid(strTab, intI6, 1)
                                                            ActiveCell.Offset(1, 0).Select
                                                        End If
                                                    Next
                                                Else
                                                    ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1) & Mid(strTab, intI5, 1)
                                                    ActiveCell.Offset(1, 0).Select
                                                End If
                                            End If
                                        Next
                                    Else
                                        ActiveCell.Value = Mid(strTab, intI1, 1) & Mid(strTab, intI2, 1) & Mid(strTab, intI3, 1) & Mid(strTab, intI4, 1)
                                        ActiveCell.Offset(1, 0).Select
                                    End If
                                End If
                            Next
                        End If
                    End If
                Next
            End If
        Next
     Next
     
     Cells(3, ActiveCell.Column).Value = (Timer - sngChrono)
     
     End Sub

Discussions similaires

  1. Réponses: 7
    Dernier message: 20/11/2012, 14h24
  2. Réponses: 2
    Dernier message: 20/01/2012, 10h03
  3. [débutant] faire un JAR avec les drivers JDBC
    Par korrigann dans le forum Eclipse Java
    Réponses: 6
    Dernier message: 29/11/2006, 16h46

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