Home » excel » validation – Excel 2010 – VBA/Formula – Unable to find how range name is defined

validation – Excel 2010 – VBA/Formula – Unable to find how range name is defined

Posted by: admin May 14, 2020 Leave a comment

Questions:

A little bit of background: I’ve been given a rather large and complicated workbook designed for another system, to modify for use with our workplace structure. Several parts of the workbook have drop-down lists that pull data from another sheet. An example is as follows:

The Data:

A_LIST  
item1  
item2  
item3  
item4  

The dropdown box source (in data validation) just says the source is =A_LIST.
I realise this normally refers to a named range, and would imply item1 – item4 had been named A_LIST, but according to the worksheet, this isn’t the case, and I can’t find anywhere in the VBA code where a range has been set to have this name.

My question is: Is there anywhere else that something like this could be set? I’m required to change A_LIST to B_LIST, but when I do this the dropdown box has trouble finding the source. I know I could just select items1-4 and rename them, but somehow this sheet has been setup to dynamically set the source to whatever data is in the list, allowing someone to add or remove items without having to change anything else.

Hope I’ve been clear enough, thanks in advance.

How to&Answers:

On the Formulas Tab there is a Name Manager, have a look in there

name manager

Additionally,

you can run this simple Sub to list all the Named Ranges and the ranges they refer too

Sub ListNamedRanges()

    Dim rngName As Name
    For Each rngName In ActiveWorkbook.Names
        Debug.Print rngName.Name, rngName.RefersTo
    Next

End Sub

Also,

Select the drop down and go to Data tab and then Data Validation

data validation

then

enter image description here