Inputbox

Salut chers tous

Aidez moi a paramétrer mon inputbox

Mon code fonctionne mal.

Merci

ci joint mon fichier test

6inputbox.xlsm (15.67 Ko)

Bonjour,

Un essai ...

La comparaison n'est pas sensible à la casse.

a égale A ... KTM égale Ktm ...

Sub CHOIX()
Dim CH As String, dl As Integer
Dim Plage, cel As Range

Application.ScreenUpdating = False

CH = InputBox(" Entrer Nom Bureau ", " Choix du Bureau ", "")
If CH = "" Then MsgBox " Vous devez choisir un Nom de BUREAU ", 48: Exit Sub

If CH <> "" Then
   dl = Range("A" & Rows.Count).End(xlUp).Row
   Set Plage = Range("A2:A" & dl)
   For Each cel In Plage
'''      If CH <> cel Then MsgBox " Nom de BUREAU Inexistant ", 48: Exit Sub
      If UCase(cel) = UCase(CH) Then
         Range("C1").Value = cel
         Exit Sub
      End If
   Next cel
   MsgBox " Il n'y a pas de correspondance. "
End If
End Sub

ric

Rechercher des sujets similaires à "inputbox"