Sub test()
MsgBox GetNameTableOfCell(ActiveCell)
End Sub
Function GetNameTableOfCell(ByVal cel As Range) As String
'renvoie "FAUX" si pas de table
Dim LstO As lisobject
GetNameTableOfCell = CStr(False)
Set LstO = cel.ListObject
If Not LstO Is Nothing Then GetNameTableOfCell = lo.Name
End Function
Sub test2()
MsgBox GetNameRangeOfCell(ActiveCell)
End Sub
Function GetNameRangeOfCell(ByVal cel As Range) As String
'renvoie "FAUX" si pas de name
Dim Nam As Name, Nom$
GetNameRangeOfCell = CStr(False)
For Each Nam In Names
Nom = Replace(Nam.RefersTo, "=", "")
If Not Intersect(Range(Nom), cel) Is Nothing Then GetNameRangeOfCell = Nam.Name
Next
End Function