ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine if Named Range exists in Worksheet (https://www.excelbanter.com/excel-programming/364717-determine-if-named-range-exists-worksheet.html)

jkt

Determine if Named Range exists in Worksheet
 
Any suggestions on writing code to look for a named range within a worksheet
and if it exists, call a macro? Otherwise if named range is not found,
continue with currenty code.

Ardus Petus

Determine if Named Range exists in Worksheet
 
dim rMyrange as range

on error resume next
set rMyrange=Range("MyRangeName")
on error goto 0

if not rMyRange is Nothing then call MyMacro


HTH
--
AP

"jkt" a écrit dans le message de news:
...
Any suggestions on writing code to look for a named range within a
worksheet
and if it exists, call a macro? Otherwise if named range is not found,
continue with currenty code.





All times are GMT +1. The time now is 04:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com