Re,
Je ne sais pas à quel moment vous avez ce message, perso à l'ouverture de votre USF je n'ai rien
En revanche votre Sub Initialize est à optimiser ainsi en typant vos variables
Option Explicit
Dim Col As Long, NbCol As Long, NomTableau As String, TblBD() As Variant, ColVisu() As Variant
Private Sub UserForm_Initialize()
Dim Ind As Long
Dim d As Dictionary
'
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 80)
Width = .Width: Height = .Height
Left = 0: Top = 0
End With
NomTableau = "Tableau1"
ColVisu = Array(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) ' colonnes à visualiser (adapter)
NbCol = Range(NomTableau).ListObject.ListColumns.Count
TblBD = Range(NomTableau).Resize(, NbCol + 1).Value
For Ind = 1 To UBound(TblBD): TblBD(Ind, NbCol + 1) = Ind: Next Ind
' Pour les colonnes
For Col = 5 To NbCol
' Si la colonne
If Col = 5 Or Col = 6 Then
Set d = CreateObject("scripting.dictionary")
For Ind = LBound(TblBD) To UBound(TblBD)
d(TblBD(Ind, Col)) = ""
Next Ind
Me.Controls("ChoixListBox" & Col - 4).List = d.keys
End If
' Si la colonne
If Col >= 10 And Col <= 23 Then
Set d = CreateObject("scripting.dictionary")
d.CompareMode = vbTextCompare
For Ind = LBound(TblBD) To UBound(TblBD)
d(TblBD(Ind, Col)) = ""
Next Ind
Me.Controls("ChoixListBox" & Col - 7).List = d.keys
End If
Next Col
Me.ListBox20.ColumnCount = NbCol + 1
Me.ListBox20.List = TblBD
End Sub
Avec "Option Explicit", vous aurez d'autre variables à définir
A+