Transfert par clic entre 2 listboxs

  • Initiateur de la discussion Bernard91
  • Date de début
B

Bernard91

Guest
Bonjour le Forum,
Je souhaitais par doubleclik faire un transfert d'éléments d'une listbox à une autre.
Lorsque je procède de la source initiale vers la cible, c'est parfait; en revanche lorsque j'essaie de faire la même chose lorsque la listbox source contient une seule ligne initialement le retour m'envoie une erreur.
'dans une macro
With UserForm1.ListBox3
.ColumnCount = 9
.ColumnWidths = '0;50;55;60;0;20;0;0;0'
.Column() = TabGeneral
End With
'Dans le formulaire
With Me.ListBox3
If .ListCount >= 1 Then
With Me.ListBox5
.ColumnCount = 4
.ColumnWidths = '54;50;40;50'
End With
With ListBox3
ListBox5.AddItem .List(.ListIndex, 1)
ListBox5.List(ListBox5.ListCount - 1, 1) = .List(.ListIndex, 2)
ListBox5.List(ListBox5.ListCount - 1, 2)= .List(.ListIndex, 3)
ListBox5.List(ListBox5.ListCount - 1, 3)= .List(.ListIndex, 5)
.RemoveItem (.ListIndex)
End With




If .ListCount >= 1 Then
If .ListIndex = -1 Then
.ListIndex = .ListCount - 1
End If
With ListBox5
ListBox3.AddItem .List(.ListIndex, 0), 1
ListBox3.List(1, 0) = .List(.ListIndex, 0)
ListBox3.List(1, 2) = .List(.ListIndex, 1)
ListBox3.List(1, 3) = .List(.ListIndex, 2)
ListBox3.List(1, 5) = .List(.ListIndex, 3)
.RemoveItem (.ListIndex)
End With
End If

Merci de votre aide
 

Discussions similaires

Réponses
4
Affichages
337

Statistiques des forums

Discussions
314 063
Messages
2 105 241
Membres
109 301
dernier inscrit
géogran