Results 1 to 4 of 4

Inconsistent scoping of Named Ranges - Debugging Issue

Threaded View

Romulo Inconsistent scoping of Named... 10-30-2013, 02:43 AM
JosephP Re: Inconsistent scoping of... 11-04-2013, 05:55 AM
Romulo Re: Inconsistent scoping of... 11-06-2013, 01:42 AM
Romulo Re: Inconsistent scoping of... 11-06-2013, 02:47 AM
  1. #1
    Registered User
    Join Date
    07-19-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2013
    Posts
    36

    Inconsistent scoping of Named Ranges - Debugging Issue

    Hello Everyone,

    I'm tearing my hair out. I have a user defined function (that is conveniently in a custom ribbon). The purpose of the function is to automatically name ranges with the top most or left most cell that contain some sort of name. I have done some manual error checking and I have done some global scope checking.

    Here is the problem. I use the following user defined functions to check the scope of named ranges. Currently everything works perfectly for the top naming. However the horizontal naming, will misidentify locally scoped names (names unique to a sheet). this is an issue.

    The problem subs in questions are 'lftregname' and 'hselect'. I've attached the file in case anyone cares to help me debug. I would much appreciate it. The two scoping UDF's I use are the following:

    Public Function LclNameExists(MyLName As String) As Boolean
    'check local scope   
    shtname = ActiveSheet.Name
       
       On Error Resume Next
       LclNameExists = Len(ThisWorkbook.Names("'" & shtname & "'!" & MyLName).Name) <> 0
    End Function
    
    Public Function NameExists(MyHName As String) As Boolean
    'check global scope   
    On Error Resume Next
       NameExists = Len(ThisWorkbook.Names(MyHName).Name) <> 0
    End Function
    Naming.xlsm
    Last edited by Romulo; 10-31-2013 at 04:38 PM. Reason: used regions instead of ranges

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Debugging and Loop issue
    By harshjog123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2012, 07:58 PM
  2. Debugging issue with VBA
    By betrayedslinky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 11:37 AM
  3. Multiple Named Ranges Pasting Loop issue
    By pacman_d in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-13-2010, 09:46 PM
  4. Debugging issue with Step Into
    By Khaos176 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-31-2009, 11:22 AM
  5. Question scoping a column and finding certain numbers
    By 0o0o0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2006, 08:40 PM

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