Excel vba ottiene valori distinti dall'intervallo

Esempi di codice

16
0

excel vba ottiene valori distinti dall'intervallo

Function DistinctVals(a, Optional col = 1)
    Dim i&, v: v = a
    With CreateObject("Scripting.Dictionary")
        For i = 1 To UBound(v): .Item(v(i, col)) = 1: Next
        DistinctVals = Application.Transpose(.Keys)
    End With
End Function

'-----------------------------------------------------------------------

'If you happen to have Office365, the above function can be shortened
'to make use of the Office365 worksheet function 'UNIQUE()' instead 
'of the dictionary:

Function DistinctVals(r As Range)
  DistinctVals = WorksheetFunction.Unique(r)
End Function

Pagine correlate

Pagine di esempio simili

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................