+ Reply to Thread
Results 1 to 3 of 3

Find invalid names via VBA

Hybrid View

  1. #1
    efree
    Guest

    Find invalid names via VBA

    Using VBA, how do I identify invalid dynamic range names?

    For Example, I would like the following to be flagged:

    "TargetRng" is defined as OFFSET(StartPoint, 0, 0, 1, 100) where
    "StartPoint" is undefined.

    Thank you for your help


  2. #2
    Ardus Petus
    Guest

    Re: Find invalid names via VBA

    Dim rng as Range
    On Error resume Next
    Set rng=Range("TargetRng")
    On Error Goto 0
    If rng is Nothing then
    MsgBox "Error"
    Else
    Whatever
    Endif

    HTH
    --
    AP

    "efree" <efreedland@stanfieldcp.com> a écrit dans le message de news:
    1152802635.793740.287080@35g2000cwc.googlegroups.com...
    > Using VBA, how do I identify invalid dynamic range names?
    >
    > For Example, I would like the following to be flagged:
    >
    > "TargetRng" is defined as OFFSET(StartPoint, 0, 0, 1, 100) where
    > "StartPoint" is undefined.
    >
    > Thank you for your help
    >




  3. #3
    efree
    Guest

    Re: Find invalid names via VBA


    Ardus Petus wrote:
    > Dim rng as Range
    > On Error resume Next
    > Set rng=3DRange("TargetRng")
    > On Error Goto 0
    > If rng is Nothing then
    > MsgBox "Error"
    > Else
    > Whatever
    > Endif
    >
    > HTH
    > --
    > AP
    >
    > "efree" <efreedland@stanfieldcp.com> a =E9crit dans le message de news:
    > 1152802635.793740.287080@35g2000cwc.googlegroups.com...
    > > Using VBA, how do I identify invalid dynamic range names?
    > >
    > > For Example, I would like the following to be flagged:
    > >
    > > "TargetRng" is defined as OFFSET(StartPoint, 0, 0, 1, 100) where
    > > "StartPoint" is undefined.
    > >
    > > Thank you for your help
    > >


    Thanks for that. Almost there...

    In adapting the methodology to my workbook at large, via:

    For Each n In ActiveWorkbook.Names
    ..=2E.
    Next

    Along with invalid dynamic ranges, the subroutine flags all of the
    names defined for formulas because, strictly speaking, those do not
    refer to ranges. For example:

    "oftenUsedFormula" - name defined as COUNTIF(A1:A500, "< 6")

    Any thoughts?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1