Introduction

You want to create a report of lists that references custom column, this can be achieved by going through all the lists by OOTB way, however that would be a cumbersome process when there are too many lists.

Here is an approach to save time to find the lists where custom column is used in. Although there are different approaches to find the references, here is a simple alternate to find lists, where custom columns are used in.

Approach

This approach uses simple Linq query to find a matching column by iterating through all of the lists. This approach also negates hidden lists and uses Fields.ContainsField API to filter the list(s) that has the column reference.

Solution

using System;
using System.Collections.Generic;
using Microsoft.SharePoint;
<p>namespace ConsoleApp
{
    class Program
    {
 static void Main(string[] args)
        {
            using (var site = new SPSite("YourSiteHere"))
            {
                using (var web = site.OpenWeb())
                
                    var lists = from list in web.Lists.OfType<SPList>() where list.Hidden == false && list.Fields.ContainsField("mycolumn") select list;
                    foreach (SPList referenceList in lists)
                    {
                        Console.WriteLine(referenceList.Title);
                    }
                    Console.Read();
                }
            }
        }
   }
}

Alternate approaches

If the requirement is for Site columns, then we can use SPField.ListsFieldUsedIn API to find the lists.  SPField.ListsFieldUsedIn based approached is well documented here

Reference

Originally this question was asked in SP forum - http://social.msdn.microsoft.com/Forums/sharepoint/en-US/a6cc12da-ff2d-4a65-a614-53481922fc83/finding-a-list-to-which-a-column-belong?forum=sharepointdevelopmentprevious