1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Function SansNom() As Variant
Dim Ligne, Col, Ctr As Byte
Application.Volatile
Ligne = Evaluate("Row()")
Col = Evaluate("column()")
If Cells(Ligne(1), Col(1) - 2) = 1 And _
Cells(Ligne(1), Col(1) - 1) = "" Then
SansNom = "not in contract"
ElseIf Cells(Ligne(1), Col(1) - 2) = 1 Then
Set c = Cells(Ligne(1), Col(1) - 2)
Ctr = 0
For i = Ligne(1) To 1 Step -1
If (Cells(i, Col(1) - 2) = 1 And Cells(i, Col(1) - 1) <> "" And Ligne(1) <> i) Or i = 1 Then
Exit For
End If
SansNom = SansNom + Cells(i, Col(1) - 1)
Next i
End If
If SansNom = 0 Then SansNom = ""
End Function |