Public Sub Worksheet_Change(ByVal Target As Range)
Dim Rng2 As Range, mess$, messinput$, Reponse$
mess = "Veuillez renseigner la cellule :"
If Target.Count > 1 Then Exit Sub
Select Case Target.Column
Case 8: If Target.Value = "oui" Then Set Rng2 = Target.Offset(, 9): messinput = Cells(1, Rng2.Column)
Case 17: If Target.Value = "oui" Then Set Rng2 = Target.Offset(, 1): messinput = Cells(1, Rng2.Column)
Case 18: If Target.Value <> "" Then Set Rng2 = Target.Offset(, 1): messinput = Cells(1, Rng2.Column)
Case Else: Set Rng2 = Nothing
End Select
If Not Rng2 Is Nothing Then GlobalImputbox mess, messinput, Target, Rng2
End Sub
Function GlobalImputbox(ByVal mess$, ByVal messinput$, ByVal rng As Range, ByVal Rng2 As Range) As String
Dim Reponse$
Reponse = InputBox(mess &" ""[" & Rng2.Address(0, 0) &&"]"" " vbCrLf & "L'immo est-elle mise en service ? : oui ou non ?")
If Reponse = "" Or " ouinon " Like "*" & Reponse & "*" Then GlobalImputbox mess, messinput, rng, Rng2 Else Rng2 = Reponse
End Function