Bonjour,
J'ai un petit souci avec mon code ci-dessous (surligné) erreur d’exécution 13 Incompatibilité de type:
Private Sub ListeChange()
Dim L As Long, Li As Long, NbL As Long, C As Byte
Dim Plage As Range
With Sheets("BDD")
DerLig = .[A65000].End(xlUp).Row
Set Plage = .Range(.Cells(2, 1), .Cells(DerLig, 5))
End With
NbL = Application.WorksheetFunction.CountIf(Plage, "=" & ComboBox1)
If NbL > 0 Then
ReDim Liste1(1 To NbL, 1 To 5)
For L = LBound(Plg, 1) To UBound(Plg, 1)
If Plg(L, 2) = ComboBox1 Then
Li = Li + 1
For C = LBound(Plg, 2) To UBound(Plg, 2)
Liste1(Li, C) = Plg(L, C)
Next C
End If
Next L
Liste = Liste1
If UBound(Liste) = 1 Then
Label1.Caption = "Il y a : " & UBound(Liste) & " résultat"
Else: Label1.Caption = "Il y a : " & UBound(Liste) & " résultats"
End If
IniLb
Else: MsgBox "Pas de données,un autre choix,svp"
End If
End Sub
Je pense que l'erreur vient du fait que la plage de cellule qu'elle va sélectionnée contient des formules... Comment puis je faire pour sélectionner une plage de données avec des formules?
Cordialement,