+ Reply to Thread
Results 1 to 7 of 7

Work around for cell name & range name conflicts?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-20-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    27

    Work around for cell name & range name conflicts?

    I currently have named ranges with names that had to be adjusted so as to not conflict with a cell designation (AA2, AB2, AC2, AD2). Basically I had to rename my ranges to AAZ, ABZ, ACZ, ADZ so as to not conflict.

    Is there a way via combo box to display AA2, AB2, AC2, AD2 but select range names AAZ, ABZ, ACZ, ADZ?

    This may seem silly, but the users prefer the real names of AA2, AB2, AC2, AD2 and not the spoofed names of AAZ, ABZ, ACZ, ADZ.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: Work around for cell name & range name conflicts?

    Why not just add 2 extra 1st letters?
    AAAA2, AAAB2 etc

    (it's never a good idea to try and use what excel would consider a cell ref, as a name for anything - even if excel would let you)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-20-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    27

    Re: Work around for cell name & range name conflicts?

    That is no better a solution than what I did. The fields AA2, AB2, AC2, AD2 are not going to be used in any part of this workbook, and my users want to use those names to select named ranges.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Work around for cell name & range name conflicts?

    You can start them with an underscore.

    IMO, though, choosing range names that look like cell references will massively confuse people that have a little knowledge of Excel.

    You could instead adopt a range naming convention, e.g., ptrAA2 for a single-cell range, rgnAA2 ("region") if a multicell range, tblAA2 for a table, colAA2 for a column reference, rowAA2 for a row reference, frmAA2 for a named formula, ...

    An advantage of that is that it keeps like categories grouped in Name Manager.
    Last edited by shg; 05-26-2016 at 03:29 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: Work around for cell name & range name conflicts?

    Kinda an extension (and improvement) on what I suggested

  6. #6
    Registered User
    Join Date
    07-20-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    27

    Re: Work around for cell name & range name conflicts?

    With a lot of trial and error, I was able to find relatively simple solution using combo box parameters and creating a 2 column list for the combo box.

    The Combo Box List (Sheet2)

    AA2 AAZ
    AB2 ABZ
    AC2 ACZ
    AD2 ADZ

    Under combo box properties set

    Bound Column = 2
    Column Count = 2
    Column Heads = False
    ColumnWidths = 1 pt;0 pt
    RowSource = Sheet2!A1:B4

    No vba required.

    Basically the combo box will list items in the first Column, but the named ranges identified in the second column are used and passed for further processing.

    My question now, is if the user wants to enter the data in a text box, is this name change possible as it was in a combo box?

  7. #7
    Registered User
    Join Date
    07-20-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    27

    Re: Work around for cell name & range name conflicts?

    My solution for text box was to use If Then ElseIf

    '-Textbox txtQTR3 exceptions to avoid cell name conflict
    Private Sub txtQTR3_AfterUpdate()
        If txtQTR3.Text = "AA2" Then
            txtQTR3.Text = "AAZ"
            ElseIf txtQTR3.Text = "AB2" Then
            txtQTR3.Text = "ABZ"
            ElseIf txtQTR3.Text = "AC2" Then
            txtQTR3.Text = "ACZ"
            ElseIf txtQTR3.Text = "AD2" Then
            txtQTR3.Text = "ADZ"
        End If
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using For Each Cell in Range() with .SpecialCells(x1CellTypeVisible) does not work
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-21-2014, 04:55 PM
  2. Search function won't work on a cell range...?
    By Jini in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-19-2012, 01:14 AM
  3. Need to ammend my code to work with a cell range rather than a cell
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2011, 08:53 AM
  4. Range Name Conflicts
    By MickeyGreen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2008, 01:41 PM
  5. Why must the starting cell be above the range for this to work?
    By ExcelQuestion in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-09-2007, 08:59 PM
  6. format a drop-down box from a range of cell from another work...
    By Jay Trull in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2006, 11:30 AM
  7. Range Name from Another Workbook conflicts with INDEX and INDIRECT
    By SubDoer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2006, 05:50 AM
  8. [SOLVED] Range Name from Another Workbook conflicts with INDEX and INDIRECT
    By SubDoer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2006, 04:10 AM

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