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
| Sub fct_suppr_all_comboBoxe()
Const cbbs = "ComboBoxe"
Const labs = "Label"
For Each c In ActiveSheet.Shapes
t_split = Split(c.Name, "_")
If t_split(0) = cbbs Or t_split(0) = labs Then
c.Select
Selection.Delete
End If
Next c
End Sub
Sub fct_affichage_search_filtressdd()
'afficher les noms de colonne + leur liste deroulante
Dim lettre, plage As String
cbx = 120 'écart sur la gauche "left"
'on FIGE l'affichage pour le User
Application.ScreenUpdating = False
'On actualise les données de la fiche source
Call main_fct_initialisation_secteurs
'On sélectionne la feuille du filtre
Sheets(sheet_search).Select
'On supprime toutes les comboBoxes
Call fct_suppr_all_comboBoxe
'Pour le nombre de critere
For i = 0 To nb_crit_sect - 1
lettre = oth_NumCol2Lettre(t_crit_sect(2, i))
plage = sheet_source & "!$" & lettre & "$4:$" & lettre & "$" & t_crit_sect(1, i) + 3
cb_width = Format(Sheets(sheet_source).Columns(t_crit_sect(2, i)).ColumnWidth * 7 + 5, "0")
'On créer la ComboBoxe
ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, DisplayAsIcon:=False, _
Left:=cbx + i * ecart, Top:=72, Width:=cb_width, Height:=cb_height).Select
Selection.Name = "ComboBoxe_" & oth_MajSsAccentEspace(t_crit_sect(0, i))
Selection.Object.TextAlign = fmTextAlignCenter
Selection.ListFillRange = plage
Selection.Object.ListRows = 13
'On créer le libellé
ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Link:=False, DisplayAsIcon:=False, _
Left:=cbx + i * ecart, Top:=52, Width:=cb_width, Height:=cb_height).Select
Selection.Name = "Label_" & oth_MajSsAccentEspace(t_crit_sect(0, i))
Selection.Object.Caption = t_crit_sect(0, i)
Selection.Object.TextAlign = fmTextAlignCenter
cbx = cbx + cb_width
'Initialise la position de la comboBox "diametre"
If t_crit_sect(0, i) = col_diametre Then
cbx_diam = cbx - cb_width + i * ecart 'cbx diametre
cbx_carac = cbx + (i + 1) * ecart 'cbx carac
nb_diams = 1
nb_max_diams = 5
End If
Next i
[O2].Select
'on DEfige l'affichage pour le User
Application.ScreenUpdating = True
'Je lance la fonction pour afficher une valeur d'une variable global et j'ai un résultat
'Dès que je la lance juste après la fin de cette fonction la variable est vide ...
Call bonjour
End Sub |
Partager