Sub a()
Dim obj As Object
Set obj = ActiveSheet
MsgBox typeouff(obj, UserForms)
MsgBox typeouff(obj, Worksheets)
End Sub
Function typeouff(obj, lacollection) As Boolean
Dim truc
For Each truc In lacollection
If truc.Name = obj.Name Then typeouff = True
Next
End Function