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
| Private Sub UserForm_Initialize()
Dim j As Integer, i As Integer
Dim temp()
Select_region.Clear
derLi = Sheets("Paramètres").Range("F1000").End(xlUp).Row
i = 1
ReDim temp(1 To derLi)
With Sheets("Paramètres")
For j = 3 To derLi
If IsError(Application.Match(.Cells(j, 1), temp, 0)) Then
temp(i) = .Cells(j, 1)
i = i + 1
End If
Next j
End With
Select_region.List = temp
End Sub
Private Sub ResultatExcel_Click()
'**************
'corps tableau
'**************
Dim Region_data(1 To 27, 0 To 18)
nom_region = Select_region.Value
'selectionne les lignes de la région selon le choix effectué par le biais de la liste deroulante
Sheets("Base de données").Select
lbdd = 1
ltab = 1
Do Until IsEmpty(Cells(ltab, 2))
If Cells(ltab, 2) = nom_region Then
For i = 0 To 18
region_data(lbdd, i) = Cells(ltab, i + 5)
Next
lbdd = lbdd + 1
End If
ltab = ltab + 1
Loop
' compléte le tableau excel avec les données selectionnées
Sheets("Tableau_region_recap").Select
Range("A27").Resize(27, 18) = Exploit_data |
Partager