XL 2016 Tableau de 14 colonnes

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

djpsy4trik

XLDnaute Nouveau
Bonjour,

depuis quelques temps j'essai de trouver un codage pas trop compliqué pour pouvoir avec mon tableau de 14 colonnes dans mon vba avec un affichage pas trop lent.

Après moult recherche j'ai trouvé quelque chose qui ne fonctionne pas trop mal (ComboListBox12) sauf que je n'ai que ma première colonne quand je l'ai adapté au mien.



merci à tous
 

Pièces jointes

bonjour deja je reduit ton userform a la taille de la plage

VB:
Private Sub UserForm_Initialize()
  Set f = Sheets("BD")
  Set d = CreateObject("Scripting.Dictionary")
  Set bd = f.Range("A2:M" & f.[M65000].End(xlUp).Row)
  For i = 1 To bd.Rows.Count
    If bd.Cells(i, 1) <> "" Then d(bd.Cells(i, 1).Value) = ""
  Next i
   Me.ListBox1.ColumnCount = bd.Columns.Count + 1
  Me.ListBox1.Width = bd.Width + bd.Cells(bd.Cells.Count).Width - 25
  temp = d.keys
  Tri temp, LBound(temp), UBound(temp)
  Me.ComboBox1.List = temp
  Me.ListBox1.List = bd.Value
   For k = 1 To 13
  With Me("label" & k)
  .Caption = f.Cells(1, k):
  .Width = f.Cells(1, k).Width
  .Left = f.Cells(1, k).Left + ListBox1.Left
 
  colwidth = colwidth & IIf(k > 1, ";", "") & f.Cells(1, k).Width
 
 
  End With
   ListBox1.ColumnWidths = colwidth
  Next k

End Sub
 
J'ai fait comme tu m'a dit:

VB:
Sub controle()
Dim nblignes As Integer
Sheets("Controle").Select
Range("A1").Select

Set f = Sheets("Controle")
  Set d = CreateObject("Scripting.Dictionary")
  Set bd = f.Range("A2:N" & f.[N65000].End(xlUp).Row)
  For I = 1 To bd.Rows.Count
    If bd.Cells(I, 1) <> "" Then d(bd.Cells(I, 1).Value) = ""
  Next I
    Me.L_controle.ColumnCount = bd.Columns.Count + 1
  Me.L_controle.Width = bd.Width + bd.Cells(bd.Cells.Count).Width - 25
  temp = d.keys
  Tri temp, LBound(temp), UBound(temp)
  Me.ComboBox1.List = temp
  Me.L_controle.List = bd.Value

 For k = 1 To 13
  With Me("label" & k)
  .Caption = f.Cells(1, k):
  .Width = f.Cells(1, k).Width
  .Left = f.Cells(1, k).Left + L_controle.Left
 
  colwidth = colwidth & IIf(k > 1, ";", "") & f.Cells(1, k).Width
 
 
  End With
   L_controle.ColumnWidths = colwidth
  Next k



End Sub



il me dit maintenant "erreur d'exécution '2147024809(80070057) "
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
14
Affichages
676
Réponses
9
Affichages
872
Retour