Bonjour,
j'ai ce code qui fonctionne mais, il aurait besoin d'aller plus vite. Je débute encore sur excel et je pense que c'est largement optimisable.
Je ne sais pas trop par où commencer j'attends vos conseils.
Merci
Sub CBO_ville_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'RECHERCHE DES DONNEES PAR LE NOM
'Désactive le rafraichissement de l'écran
Application.ScreenUpdating = False
Sheets("BD_Ville").Select
Range("D1").Select
If CBO_ville = "" Then
Exit Sub
Else
Do Until ActiveCell = UCase(CBO_ville) Or ActiveCell = ""
Selection.Offset(1#).Select
Loop
If ActiveCell = UCase(CBO_ville) Then
ActiveCell.Select
Selection.Offset(0, -2).Select
Me.CBO_DEP = ActiveCell 'Département
Selection.Offset(0, -1).Select
Me.CBO_ID_BD_VILLE = ActiveCell 'ID_ville
Selection.Offset(0, 8).Select
Me.CBO_code_postal = ActiveCell 'Code postal
End If
End If
'Réactive le rafraichissement de l'écran
Application.ScreenUpdating = True
End Sub