Bonne après-midi à chacun (et bientôt bon Weekend),
Voici un petit programme qui utilise la VLookup. Mais il ne tient pas compte des majuscules. Si je cherche « a » il me répond « 1 » alors qu’il devrait le répondre seulement pour « A ».
Ma question : Comment introduire « MatchCase:=True » dans la fonction VLookup ?
Voici les données :
A 1
B 2
C 3
D 4
Voici le code :
Merci par avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 Sub NuméroLigneR() Dim R As Variant, ValeurCherchée As String ValeurCherchée = InputBox("Valeur cherchée ? ") R = Application.VLookup(ValeurCherchée, Range("A1:B4"), 2, False) If IsError(R) Then MsgBox "Valeur inexistante" Else MsgBox R End If End Sub
RéviAT
Partager