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
| Private Sub T_Cons_CBBIC_Init()
Dim CBR As Range, CellCBR As Range, CBS As Range, CellCBS As Range
Dim derLig As Integer, derCol As Integer
'Le fonctionnement est sensiblement identique à T_Cons_CBSite_Init...
Set Wb = ThisWorkbook
'En premier ici. Mais lorsque je clique sur Débogage, puis de nouveau sur Exécuter... surprise ça fonctionne !
Wb.Sheets(3).Select
derCol = Wb.Sheets(3).Cells(1, Columns.Count).End(xlToLeft).Column
'En second ici... Mais lorsque je clique sur Débogage, puis de nouveau sur Exécuter... eh bah ça fonctionne aussi...
Set CBR = Wb.Sheets(3).Range(Cells(1, 1), Cells(1, derCol))
For Each CellCBR In CBR
If CellCBR.Value = Frame1.Caption Then
derLig = Wb.Sheets(3).Cells(Rows.Count, CellCBR.Column).End(xlUp).Row
Set CBS = Wb.Sheets(3).Range(Cells(2, CellCBR.Column), Cells(derLig, CellCBR.Column))
For Each CellCBS In CBS
T_Cons_CBBIC.AddItem (CellCBS.Value)
Next
End If
Next
'...à quelques détails près
T_Cons_LBBIC.Visible = True
T_Cons_CBBIC.Visible = True
'On rend de nouveau visibles la CheckBox_BIC et le Label_BIC
End Sub |
Partager