Function DERCEL(premcel As Range, Optional r As Boolean)
'si le 2ème argument est VRAI, le Range est renvoyé
Application Volatile
Set DERCEL = DER(DER(premcel, True), False)
If Not r Then DERCEL = DERCEL.Address(0, 0)
End Function
Function DER(c As Range, lig As Boolean) As Range
Dim test As Boolean, i As Byte
test = True
While test
Set c = IIf(lig, c(2, 1), c(1, 2))
For i = 7 To 10
If c.Borders(i).LineStyle = xlNone Then _
test = False: Exit For
Next
Wend
Set DER = IIf(lig, c(0, 1), c(1, 0))
End Function