Hello,
I'm fairly new to VBA with Excel, and i'm wondering if there's anyway i can search through a workbook to find Named Ranges a user may have created with excel. Using the Insert-> Name -> Define features provided on the Menu bar. I'm hoping to copy the named ranges from each worksheet onto the last worksheet within this workbook.
apparently this code does not work:
with activeworkbook
for each RangeName in .Names
if instr(RangeName, "string1"
<> 0 then (compare if the Range name is found within the worksheet/activeworkbook)
msgbox "Range name found is " & RangeName
endif
next
end with
If anyone can help i'd appreciate it, once again i'm search for named ranges already created by a user. The code above just gives my the actual cells positions if a cell has a value not a named range.
I'm fairly new to VBA with Excel, and i'm wondering if there's anyway i can search through a workbook to find Named Ranges a user may have created with excel. Using the Insert-> Name -> Define features provided on the Menu bar. I'm hoping to copy the named ranges from each worksheet onto the last worksheet within this workbook.
apparently this code does not work:
with activeworkbook
for each RangeName in .Names
if instr(RangeName, "string1"
msgbox "Range name found is " & RangeName
endif
next
end with
If anyone can help i'd appreciate it, once again i'm search for named ranges already created by a user. The code above just gives my the actual cells positions if a cell has a value not a named range.