Excel 2007
我在 A 列中有大约 1000 行,其中 250 行是唯一的。我需要 250 个唯一行以用户选择多个项目的形式显示。我一直在使用带有高级过滤器的宏记录器,但无法填充列表。我正在尝试将列表分配给 Range 变量。
Public Sub UniqueCMFundList()
Dim CMFundList As Range
Dim RangeVar1 As Range
Dim RangeVar2 As Range
Sheets("HiddenDataList").Activate
Range("A2").Select
Set RangeVar1 = Range(Selection, Selection.End(xlDown)).Select
Set CMFundList = RangeVar1.AdvancedFilter(xlFilterInPlace, , , True)
'This is what I get with macro recorder:
'Range("A1:A1089").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
' Range("A1:A1089"), Unique:=True
Debug.Print CMFundList.Value
End Sub