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
|
Private Sub CommandButton1_Click()
Dim selecteditems As String
Dim compt As Integer
For I = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(I) = True Then
selecteditems = selecteditems & ListBox1.List(I)
compt = I 'LIGNE A AJOUTER
Exit For 'LIGNE A AJOUTER
End If
Next I
If selecteditems = "" Then
MsgBox "pas de Devis selectioner"
Else
Dim Ligne As String
Dim LigneExcel1 As Integer
'Dim compt As Integer 'A DEPLACER EN DEBUT DE CODE
LigneExcel1 = 2
With ActiveWorkbook.Worksheets("resultat")
.Cells(LigneExcel1, 1) = ListBox1.List(compt)
.Cells(LigneExcel1, 2) = ListBox1.List(compt, 1)
.Cells(LigneExcel1, 3) = ListBox1.List(compt, 2)
.Cells(LigneExcel1, 4) = ListBox1.List(compt, 3)
.Cells(LigneExcel1, 5) = ListBox1.List(compt, 4)
.Cells(LigneExcel1, 6) = ListBox1.List(compt, 5)
.Cells(LigneExcel1, 7) = ListBox1.List(compt, 6)
.Cells(LigneExcel1, 8) = ListBox1.List(compt, 7)
.Cells(LigneExcel1, 9) = ListBox1.List(compt, 8)
.Cells(LigneExcel1, 10) = ListBox1.List(compt, 9)
.Cells(LigneExcel1, 11) = ListBox1.List(compt, 10)
.Cells(LigneExcel1, 12) = ListBox1.List(compt, 11)
.Cells(LigneExcel1, 13) = ListBox1.List(compt, 12)
.Cells(LigneExcel1, 14) = ListBox1.List(compt, 13)
.Cells(LigneExcel1, 15) = ListBox1.List(compt, 14)
.Cells(LigneExcel1, 16) = ListBox1.List(compt, 15)
.Cells(LigneExcel1, 17) = ListBox1.List(compt, 16)
.Cells(LigneExcel1, 18) = ListBox1.List(compt, 17)
.Cells(LigneExcel1, 19) = ListBox1.List(compt, 18)
.Cells(LigneExcel1, 20) = ListBox1.List(compt, 19)
.Cells(LigneExcel1, 21) = ListBox1.List(compt, 20)
.Cells(LigneExcel1, 22) = ListBox1.List(compt, 21)
.Cells(LigneExcel1, 23) = ListBox1.List(compt, 22)
.Cells(LigneExcel1, 24) = ListBox1.List(compt, 23)
.Cells(LigneExcel1, 25) = ListBox1.List(compt, 24)
.Cells(LigneExcel1, 26) = ListBox1.List(compt, 25)
.Cells(LigneExcel1, 27) = ListBox1.List(compt, 26)
.Cells(LigneExcel1, 28) = ListBox1.List(compt, 27)
.Cells(LigneExcel1, 29) = ListBox1.List(compt, 28)
.Cells(LigneExcel1, 30) = ListBox1.List(compt, 29)
.Cells(LigneExcel1, 31) = ListBox1.List(compt, 30)
.Cells(LigneExcel1, 32) = ListBox1.List(compt, 31)
.Cells(LigneExcel1, 33) = ListBox1.List(compt, 32)
.Cells(LigneExcel1, 34) = ListBox1.List(compt, 33)
.Cells(LigneExcel1, 35) = ListBox1.List(compt, 34)
.Cells(LigneExcel1, 36) = ListBox1.List(compt, 35)
.Cells(LigneExcel1, 37) = ListBox1.List(compt, 36)
.Cells(LigneExcel1, 38) = ListBox1.List(compt, 37)
.Cells(LigneExcel1, 39) = ListBox1.List(compt, 38)
.Cells(LigneExcel1, 40) = ListBox1.List(compt, 39)
.Cells(LigneExcel1, 41) = ListBox1.List(compt, 40)
.Cells(LigneExcel1, 42) = ListBox1.List(compt, 41)
.Cells(LigneExcel1, 43) = ListBox1.List(compt, 42)
.Cells(LigneExcel1, 44) = ListBox1.List(compt, 43)
.Cells(LigneExcel1, 45) = ListBox1.List(compt, 44)
.Cells(LigneExcel1, 46) = ListBox1.List(compt, 45)
.Cells(LigneExcel1, 47) = ListBox1.List(compt, 46)
.Cells(LigneExcel1, 48) = ListBox1.List(compt, 47)
.Cells(LigneExcel1, 49) = ListBox1.List(compt, 48)
.Cells(LigneExcel1, 50) = ListBox1.List(compt, 49)
.Cells(LigneExcel1, 51) = ListBox1.List(compt, 50)
.Cells(LigneExcel1, 52) = ListBox1.List(compt, 51)
.Cells(LigneExcel1, 53) = ListBox1.List(compt, 52)
.Cells(LigneExcel1, 54) = ListBox1.List(compt, 53)
.Cells(LigneExcel1, 55) = ListBox1.List(compt, 54)
.Cells(LigneExcel1, 56) = ListBox1.List(compt, 55)
.Cells(LigneExcel1, 57) = ListBox1.List(compt, 56)
.Cells(LigneExcel1, 58) = ListBox1.List(compt, 56)
.Cells(LigneExcel1, 59) = ListBox1.List(compt, 58)
.Cells(LigneExcel1, 60) = ListBox1.List(compt, 59)
.Cells(LigneExcel1, 61) = ListBox1.List(compt, 60)
.Cells(LigneExcel1, 62) = ListBox1.List(compt, 61)
.Cells(LigneExcel1, 63) = ListBox1.List(compt, 62)
.Cells(LigneExcel1, 64) = ListBox1.List(compt, 63)
.Cells(LigneExcel1, 65) = ListBox1.List(compt, 64)
.Cells(LigneExcel1, 66) = ListBox1.List(compt, 65)
.Cells(LigneExcel1, 67) = ListBox1.List(compt, 66)
.Cells(LigneExcel1, 68) = ListBox1.List(compt, 67)
.Cells(LigneExcel1, 69) = ListBox1.List(compt, 68)
.Cells(LigneExcel1, 70) = ListBox1.List(compt, 69)
.Cells(LigneExcel1, 71) = ListBox1.List(compt, 70)
.Cells(LigneExcel1, 72) = ListBox1.List(compt, 71)
.Cells(LigneExcel1, 73) = ListBox1.List(compt, 72)
.Cells(LigneExcel1, 74) = ListBox1.List(compt, 73)
.Cells(LigneExcel1, 75) = ListBox1.List(compt, 74)
.Cells(LigneExcel1, 76) = ListBox1.List(compt, 75)
.Cells(LigneExcel1, 77) = ListBox1.List(compt, 76)
.Cells(LigneExcel1, 78) = ListBox1.List(compt, 77)
.Cells(LigneExcel1, 79) = ListBox1.List(compt, 78)
.Cells(LigneExcel1, 80) = ListBox1.List(compt, 79)
.Cells(LigneExcel1, 81) = ListBox1.List(compt, 80)
.Cells(LigneExcel1, 82) = ListBox1.List(compt, 81)
.Cells(LigneExcel1, 83) = ListBox1.List(compt, 82)
.Cells(LigneExcel1, 84) = ListBox1.List(compt, 83)
.Cells(LigneExcel1, 85) = ListBox1.List(compt, 84)
.Cells(LigneExcel1, 86) = ListBox1.List(compt, 85)
.Cells(LigneExcel1, 87) = ListBox1.List(compt, 86)
.Cells(LigneExcel1, 88) = ListBox1.List(compt, 87)
.Cells(LigneExcel1, 89) = ListBox1.List(compt, 88)
.Cells(LigneExcel1, 90) = ListBox1.List(compt, 89)
.Cells(LigneExcel1, 91) = ListBox1.List(compt, 90)
.Cells(LigneExcel1, 92) = ListBox1.List(compt, 91)
.Cells(LigneExcel1, 93) = ListBox1.List(compt, 92)
.Cells(LigneExcel1, 94) = ListBox1.List(compt, 93)
.Cells(LigneExcel1, 95) = ListBox1.List(compt, 94)
.Cells(LigneExcel1, 96) = ListBox1.List(compt, 95)
.Cells(LigneExcel1, 97) = ListBox1.List(compt, 96)
.Cells(LigneExcel1, 98) = ListBox1.List(compt, 97)
.Cells(LigneExcel1, 99) = ListBox1.List(compt, 98)
.Cells(LigneExcel1, 100) = ListBox1.List(compt, 99)
.Cells(LigneExcel1, 101) = ListBox1.List(compt, 100)
.Cells(LigneExcel1, 102) = ListBox1.List(compt, 101)
.Cells(LigneExcel1, 103) = ListBox1.List(compt, 102)
.Cells(LigneExcel1, 104) = ListBox1.List(compt, 103)
.Cells(LigneExcel1, 105) = ListBox1.List(compt, 104)
.Cells(LigneExcel1, 106) = ListBox1.List(compt, 105)
.Cells(LigneExcel1, 107) = ListBox1.List(compt, 106)
.Cells(LigneExcel1, 108) = ListBox1.List(compt, 107)
LigneExcel = LigneExcel + 1
End With
End If
End Sub |