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 :

Gestion parc machine_soumission des machines [XL-2013]


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Responsable Maintenance
    Inscrit en
    Août 2015
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Responsable Maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Août 2015
    Messages : 17
    Par défaut Gestion parc machine_soumission des machines
    Bjr!
    Concernant mon application de gestion parc machine j'ai un autre pb:
    je veux savoir comment deplacer une ligne d'une feuille à l'autre:
    j'ai arrive à faire copier la ligne d'une feuille et la coller sur une autre mais la mon besoin c'est de la deplacer complement: la faire disparaitre d'une feuille et la mettre dans une autre feuille :
    Mon code est: j'effectue la recherché de la machine pour m'assurer de ses données ensuite en cliquant sur un boutton je la déplace d'une feuille source à une feuille de distination!
    et maerci d'avance
    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
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
     
    Option Explicit
    Function IsRefExist(rng As Range, ref As String) As Boolean
     IsRefExist = Application.CountIf(rng, ref) = 0
    End Function
    Private Sub CommandButton10_Click()
    Sheets("ST").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("ST").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton15_Click()
    Sheets("SZ").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("SZ").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton16_Click()
    Sheets("TUNICO").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("TUNICO").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton14_Click()
    Sheets("FACTORY").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("FACTORY").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton17_Click()
    Sheets("BELGIQUE").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("BELGIQUE").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton18_Click()
    Sheets("Machines").Activate
        If ComboBox8.ListIndex < 0 Then
             MsgBox "Vous devez taper le Numéro de série fabriquant"
             End If
        Dim Machines As Worksheet
        Dim no_ligne As Integer
        no_ligne = ComboBox8.ListIndex + 2
            TextBox35.Value = Cells(no_ligne, 1).Value
            TextBox36.Value = Cells(no_ligne, 2).Value
            TextBox37.Value = Cells(no_ligne, 3).Value
            TextBox38.Value = Cells(no_ligne, 4).Value
            TextBox39.Value = Cells(no_ligne, 5).Value
            TextBox40.Value = Cells(no_ligne, 6).Value
            TextBox41.Value = Cells(no_ligne, 7).Value
            TextBox42.Value = Cells(no_ligne, 8).Value
            TextBox43.Value = Cells(no_ligne, 9).Value
            TextBox44.Value = Cells(no_ligne, 10).Value
            TextBox45.Value = Cells(no_ligne, 11).Value
            TextBox46.Value = Cells(no_ligne, 12).Value
            TextBox47.Value = Cells(no_ligne, 13).Value
            TextBox48.Value = Cells(no_ligne, 14).Value
            TextBox49.Value = Cells(no_ligne, 15).Value
            TextBox50.Value = Cells(no_ligne, 16).Value
    End Sub
    Private Sub CommandButton19_Click()
    Sheets("Machines").Activate
        If ComboBox6.ListIndex < 0 Then
             MsgBox "Vous devez taper la Nouvelle Réf Interne"
         End If
        Dim Machines As Worksheet
        Dim no_ligne As Integer
        no_ligne = ComboBox6.ListIndex + 2
            TextBox35.Value = Cells(no_ligne, 1).Value
            TextBox36.Value = Cells(no_ligne, 2).Value
            TextBox37.Value = Cells(no_ligne, 3).Value
            TextBox38.Value = Cells(no_ligne, 4).Value
            TextBox39.Value = Cells(no_ligne, 5).Value
            TextBox40.Value = Cells(no_ligne, 6).Value
            TextBox41.Value = Cells(no_ligne, 7).Value
            TextBox42.Value = Cells(no_ligne, 8).Value
            TextBox43.Value = Cells(no_ligne, 9).Value
            TextBox44.Value = Cells(no_ligne, 10).Value
            TextBox45.Value = Cells(no_ligne, 11).Value
            TextBox46.Value = Cells(no_ligne, 12).Value
            TextBox47.Value = Cells(no_ligne, 13).Value
            TextBox48.Value = Cells(no_ligne, 14).Value
            TextBox49.Value = Cells(no_ligne, 15).Value
            TextBox50.Value = Cells(no_ligne, 16).Value
    End Sub
    Private Sub CommandButton20_Click()
        TextBox35 = ""       'Vider le continue du TextBox'
        TextBox36 = ""
        TextBox37 = ""
        TextBox38 = ""
        TextBox39 = ""
        TextBox40 = ""
        TextBox41 = ""
        TextBox42 = ""
        TextBox43 = ""
        TextBox44 = ""
        TextBox45 = ""
        TextBox46 = ""
        TextBox47 = ""
        TextBox48 = ""
        TextBox49 = ""
        TextBox50 = ""
            ComboBox5.Value = ""       'Vider le continue du ComboBox'
            ComboBox6.Value = ""
            ComboBox8.Value = ""
    End Sub
    Private Sub CommandButton9_Click()
        Sheets("Machines").Activate
        If ComboBox5.ListIndex < 0 Then
             MsgBox "Vous devez taper l'Ancienne Réf Interne"
            End If
        Dim Machines As Worksheet
        Dim no_ligne As Integer
        no_ligne = ComboBox5.ListIndex + 2
            TextBox35.Value = Cells(no_ligne, 1).Value
            TextBox36.Value = Cells(no_ligne, 2).Value
            TextBox37.Value = Cells(no_ligne, 3).Value
            TextBox38.Value = Cells(no_ligne, 4).Value
            TextBox39.Value = Cells(no_ligne, 5).Value
            TextBox40.Value = Cells(no_ligne, 6).Value
            TextBox41.Value = Cells(no_ligne, 7).Value
            TextBox42.Value = Cells(no_ligne, 8).Value
            TextBox43.Value = Cells(no_ligne, 9).Value
            TextBox44.Value = Cells(no_ligne, 10).Value
            TextBox45.Value = Cells(no_ligne, 11).Value
            TextBox46.Value = Cells(no_ligne, 12).Value
            TextBox47.Value = Cells(no_ligne, 13).Value
            TextBox48.Value = Cells(no_ligne, 14).Value
            TextBox49.Value = Cells(no_ligne, 15).Value
            TextBox50.Value = Cells(no_ligne, 16).Value
    End Sub
    Private Sub CommandButton12_Click()
        Unload SoumissionDesMachines
        MenuPrincipale.Show
    End Sub
    Private Sub ComboBox5_Change()
    Sheets("Machines").Activate
    If IsRefExist(Range("A:A"), ComboBox5) Then
      MsgBox "Ancienne Réf Interne Introuvable"
      ComboBox5.Value = ""
     End If
    End Sub
    Private Sub ComboBox6_Change()
    Sheets("Machines").Activate
    If IsRefExist(Range("B:B"), ComboBox6) Then
      MsgBox "Ancienne Réf Interne Introuvable"
      ComboBox6.Value = ""
     End If
    End Sub
    Private Sub ComboBox8_Change()
    Sheets("Machines").Activate
    If IsRefExist(Range("C:C"), ComboBox8) Then
      MsgBox "Ancienne Réf Interne Introuvable"
      ComboBox8.Value = ""
     End If
    End Sub

  2. #2
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Septembre 2011
    Messages
    8 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Septembre 2011
    Messages : 8 208
    Par défaut
    Bonjour,

    Où se trouve la copie de ligne ?

  3. #3
    Membre averti
    Homme Profil pro
    Responsable Maintenance
    Inscrit en
    Août 2015
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Responsable Maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Août 2015
    Messages : 17
    Par défaut Détaille de copie
    Pour etre Claire j'ai une feuille source (Machines) et 5 feuilles de distination (ST, SZ, TUNICO, FACTORY et BELGIQUE) et j'ai fait 5 bouttons de commande (CommandButton10, 15, 16, 14 et 17) chacune copie une ligne de la feuille source vers sa feuille de distination adéquoite, biensure après avoir afficher les données dans les textbox avec le boutton recherche:
    donc les etapes s'effectue comme suite d'exemple:
    je selectionne la machine dans un combobox ensuite je clic sur le bouton de recherche les détailles de la machines s'affichent dans des différents textbox ensuite je clic sur un des 5 bouttons desirer et ça copies les données de la machine(feuille source "Machines")vers la feuille de distination adéquoite
    NB: Binesure avec une verification selon la colonne "A", "B" et "C" si cette ligne existe dans la feuille de distination Msgbox "machine existe déja" si non msgbox" vous etes sure de vouloir soummetre cette machine" (valider ou anuuler))
    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
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
     
    Private Sub CommandButton10_Click()
    Sheets("ST").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("ST").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton15_Click()
    Sheets("SZ").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("SZ").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton16_Click()
    Sheets("TUNICO").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("TUNICO").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton14_Click()
    Sheets("FACTORY").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("FACTORY").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub
    Private Sub CommandButton17_Click()
    Sheets("BELGIQUE").Activate
        Dim derligne As Integer
            If MsgBox("Voulez-vous ajouter cette machine?", vbYesNo, "confirmation") = vbYes Then
            derligne = Sheets("BELGIQUE").Range("A10000").End(xlUp).Row + 1
                Cells(derligne, 1) = TextBox35.Value
                Cells(derligne, 2) = TextBox36.Value
                Cells(derligne, 3) = TextBox37.Value
                Cells(derligne, 4) = TextBox38.Value
                Cells(derligne, 5) = TextBox39.Value
                Cells(derligne, 6) = TextBox40.Value
                Cells(derligne, 7) = TextBox41.Value
                Cells(derligne, 8) = TextBox42.Value
                Cells(derligne, 9) = TextBox43.Value
                Cells(derligne, 10) = TextBox44.Value
                Cells(derligne, 11) = TextBox45.Value
                Cells(derligne, 12) = TextBox46.Value
                Cells(derligne, 13) = TextBox47.Value
                Cells(derligne, 14) = TextBox48.Value
                Cells(derligne, 15) = TextBox49.Value
                Cells(derligne, 16) = TextBox50.Value
        End If
        Unload Me
        SoumissionDesMachines.Show
    End Sub

  4. #4
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Septembre 2011
    Messages
    8 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Septembre 2011
    Messages : 8 208
    Par défaut
    Quand tu alimentes les textboxes, note dans une variable le numéro de la ligne source. Cette variable servira à supprimer la ligne après copie.

  5. #5
    Membre averti
    Homme Profil pro
    Responsable Maintenance
    Inscrit en
    Août 2015
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Responsable Maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Août 2015
    Messages : 17
    Par défaut c fait!!
    Mr je vous remercie pour votre aide mais il faut savoir que je suis Presque nule en développement et je suis entrain de débuter en vba.
    c fait dès le debute mais rien n'est effacer:
    voila le code:
    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
     
    Private Sub CommandButton9_Click()
        Sheets("Machines").Activate
        If ComboBox5.ListIndex < 0 Then
             MsgBox "Vous devez taper l'Ancienne Réf Interne"
            End If
        Dim Machines As Worksheet
        Dim no_ligne As Integer
        no_ligne = ComboBox5.ListIndex + 2
            TextBox35.Value = Cells(no_ligne, 1).Value
            TextBox36.Value = Cells(no_ligne, 2).Value
            TextBox37.Value = Cells(no_ligne, 3).Value
            TextBox38.Value = Cells(no_ligne, 4).Value
            TextBox39.Value = Cells(no_ligne, 5).Value
            TextBox40.Value = Cells(no_ligne, 6).Value
            TextBox41.Value = Cells(no_ligne, 7).Value
            TextBox42.Value = Cells(no_ligne, 8).Value
            TextBox43.Value = Cells(no_ligne, 9).Value
            TextBox44.Value = Cells(no_ligne, 10).Value
            TextBox45.Value = Cells(no_ligne, 11).Value
            TextBox46.Value = Cells(no_ligne, 12).Value
            TextBox47.Value = Cells(no_ligne, 13).Value
            TextBox48.Value = Cells(no_ligne, 14).Value
            TextBox49.Value = Cells(no_ligne, 15).Value
            TextBox50.Value = Cells(no_ligne, 16).Value
    End Sub

  6. #6
    Expert confirmé
    Homme Profil pro
    aucune
    Inscrit en
    Septembre 2011
    Messages
    8 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : aucune

    Informations forums :
    Inscription : Septembre 2011
    Messages : 8 208
    Par défaut
    Poste la partie de ton code qui remplit les textboxes.

  7. #7
    Membre averti
    Homme Profil pro
    Responsable Maintenance
    Inscrit en
    Août 2015
    Messages
    17
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Responsable Maintenance
    Secteur : Industrie

    Informations forums :
    Inscription : Août 2015
    Messages : 17
    Par défaut
    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
    Private Sub CommandButton9_Click()
        Sheets("Machines").Activate
        If ComboBox5.ListIndex < 0 Then
             MsgBox "Vous devez taper l'Ancienne Réf Interne"
            End If
        Dim Machines As Worksheet
        Dim no_ligne As Integer
        no_ligne = ComboBox5.ListIndex + 2
            TextBox35.Value = Cells(no_ligne, 1).Value
            TextBox36.Value = Cells(no_ligne, 2).Value
            TextBox37.Value = Cells(no_ligne, 3).Value
            TextBox38.Value = Cells(no_ligne, 4).Value
            TextBox39.Value = Cells(no_ligne, 5).Value
            TextBox40.Value = Cells(no_ligne, 6).Value
            TextBox41.Value = Cells(no_ligne, 7).Value
            TextBox42.Value = Cells(no_ligne, 8).Value
            TextBox43.Value = Cells(no_ligne, 9).Value
            TextBox44.Value = Cells(no_ligne, 10).Value
            TextBox45.Value = Cells(no_ligne, 11).Value
            TextBox46.Value = Cells(no_ligne, 12).Value
            TextBox47.Value = Cells(no_ligne, 13).Value
            TextBox48.Value = Cells(no_ligne, 14).Value
            TextBox49.Value = Cells(no_ligne, 15).Value
            TextBox50.Value = Cells(no_ligne, 16).Value
    End Sub

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

Discussions similaires

  1. [XL-2013] Gestion parc machines
    Par ilyes.sferi dans le forum Macros et VBA Excel
    Réponses: 10
    Dernier message: 11/10/2015, 15h05
  2. [PowerShell] gestion fichier CSV : Script d'audit PARC PC des Admins locaux + listing CSV
    Par 0boulot dans le forum Scripts/Batch
    Réponses: 5
    Dernier message: 09/10/2015, 10h51
  3. Réponses: 1
    Dernier message: 05/12/2011, 17h35
  4. [Nagios] Gestion des machines windows
    Par marveljojo75 dans le forum Réseau
    Réponses: 2
    Dernier message: 07/01/2009, 11h23
  5. Réponses: 4
    Dernier message: 24/11/2005, 20h51

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