Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing in a macro for bad range name?
I'm working on a project that opens each old workbook in a folder and
extracts data. Some of these workbooks have bad range names, e.g. with #REF as part of the refers to. A test against the list of workbook range names passes. You can't test for iserror, as you can't even read it. Setting an On Error GoTo xxx doesn't kick in for some strange reason. How can I test for the invalid range name and branch accordingly? Don <donwiss at panix.com. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Testing in a macro for bad range name?
Try this:
Dim nm as Name for each nm in Activeworkbook.Names if instr(1,nm.Refersto,"#REF",vbTextCompare) then msgbox nm.name & " " & nm.Refersto end if Next Untested. -- Regards, Tom Ogilvy "Don Wiss" wrote in message ... I'm working on a project that opens each old workbook in a folder and extracts data. Some of these workbooks have bad range names, e.g. with #REF as part of the refers to. A test against the list of workbook range names passes. You can't test for iserror, as you can't even read it. Setting an On Error GoTo xxx doesn't kick in for some strange reason. How can I test for the invalid range name and branch accordingly? Don <donwiss at panix.com. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TESTING A RANGE OF CELLS | New Users to Excel | |||
TESTING A RANGE OF CELLS | Excel Worksheet Functions | |||
Testing a person's age to be within a range | Excel Worksheet Functions | |||
Testing for content in Range | Excel Programming | |||
Testing for existence of range | Excel Programming |