
Private Sub GetDistinctValues()
Dim v() As Variant
With CreateObject("ADODB.Recordset")
.Open "SELECT DISTINCT [Werte] FROM `Tabelle1$`", _
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.FullName & _
";Extended Properties=""Excel 12.0 Xml"""
v = .GetRows
.Close
End With
End Sub
Ergebnis:

Hinweis:
Arbeitsmappe muss gespeichert und XLSM sein.
Für andere Dateitypen bedarf es einer Änderung in den Extended Properties.
|