+ Reply to Thread
Results 1 to 9 of 9

Finding Unique Values in Named Range

Hybrid View

  1. #1
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Finding Unique Values in Named Range

    There are a couple of ways to do this. Since you didn't specify what you wanted done with the unique values I will assume you want them copied to another sheet (Sheet2 in this case). I also assumed each named range had a header which you didn't want counted.

    Sub Find_Uniques_inNamed_Ranges()
    Dim ws1 As Worksheet:   Set ws1 = Sheets("Sheet1") 'source sheet
    Dim ws2 As Worksheet:   Set ws2 = Sheets("Sheet2") 'output Sheet
    Dim arrRange As Variant
    Dim i As Integer
    
    arrRange = Array("Zone_101", "Zone_102", "Zone_103") 'you will need to add the rest of the names.  Follow the same format.
    
    Application.ScreenUpdating = False
    
    For i = LBound(arrRange) To UBound(arrRange)
        ws1.Range(arrRange(i)).AdvancedFilter xlFilterInPlace, , , True
        ws1.Range(arrRange(i)).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy Destination:=ws2.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    Next i
    
    ws1.ShowAllData
    ws1.UsedRange.EntireRow.Hidden = False
    
    Application.ScreenUpdating = True
    
    End Sub

  2. #2
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Finding Unique Values in Named Range

    I just need a total count of unique values. For example once inv is downloaded there are 57k bins we use. However there are only 29k unique values in that list.

+ 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. Excel not finding values in a named range
    By Lifferds in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-07-2013, 09:35 AM
  2. Replies: 8
    Last Post: 02-21-2012, 11:11 AM
  3. List Unique Values in a Named Range
    By tomlancaster in forum Excel General
    Replies: 4
    Last Post: 02-17-2011, 08:53 AM
  4. Replies: 6
    Last Post: 10-14-2009, 03:01 AM
  5. Finding unique values from a filtered range
    By Rich in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2006, 11:00 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