Results 1 to 3 of 3
  1. #1
    Star Lounger PStepanas's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    90
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Question Want to return Data Validation list location

    Is there any way (VBA or otherwise) to return the location of the Data Validation list for a cell?

    I'm documenting a spreadsheet, particularly the inputs to the calculation. I'd like to create a formula that shows from where each input cell is getting its allowed values. This should not only be quicker than copying the text from the Data Validation dialogue, but it would be robust to changes.

    Any info appreciated.

    (Excel 2010)

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,638
    Thanks
    115
    Thanked 650 Times in 592 Posts
    PStephens,

    The following User Defined Function will return the address of the validation list of a cell.

    If Cell A2 has a validation list of L4 to L8, in cell C2 for example, enter the formula:

    =ValidationList(A2)

    In a standard module:
    Code:
    Public Function ValidationList(rng As Range) As String
        ValidationList = rng.Validation.Formula1
    End Function
    HTH,
    Maud

    ValidationList.png

  3. #3
    Star Lounger PStepanas's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    90
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Smile

    Thanks, Maud!

    Exactly what I was after.

Tags for this Thread

Posting Permissions

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