I want to loop through all of the defined names pertaining to my sheet. That's the easy part, the issue i am encountering is that the workbook's many auto filter ranges must be stored as a defined name, which is not want i want. None of those filters were named intentionally. And the code i'm using is failing when reaching a range that's a filter. the code is commonly used i believe.
Here's where it's failing. My active sheet name is ISEntry, the comparison is name of the sheet of the active defined name. it should only go to the msgbox when ISEntry = ISEntry of course, well the line nm.RefersToRange.Parent.name is failing and the resume next is there to go ahead and tell me the name that's failing. The message is "HostedPropasl!_FilterDatabase" this is telling me that the filters are being stored as defined names even though i have not intentionally defined them. How do i work around this? I ONLY want the defined names, not this filter stuff. I assume the line is failing because there is no parent name? I'm not sure.
Code:
For Each nm In ActiveWorkbook.Names
on error resume next
If nm.RefersToRange.Parent.name = ActiveSheet.name Then
MsgBox nm.name
End If
Next nm
Here's where it's failing. My active sheet name is ISEntry, the comparison is name of the sheet of the active defined name. it should only go to the msgbox when ISEntry = ISEntry of course, well the line nm.RefersToRange.Parent.name is failing and the resume next is there to go ahead and tell me the name that's failing. The message is "HostedPropasl!_FilterDatabase" this is telling me that the filters are being stored as defined names even though i have not intentionally defined them. How do i work around this? I ONLY want the defined names, not this filter stuff. I assume the line is failing because there is no parent name? I'm not sure.
Last edited: