關於Scripting.Dictionary除了過濾重複值,是否可以同時忽略空值?
- 帖子
- 1567
- 主題
- 40
- 精華
- 0
- 積分
- 1591
- 點名
- 0
- 作業系統
- Windows 7
- 軟體版本
- Excel 2010 & 2016
- 閱讀權限
- 100
- 性別
- 男
- 來自
- 台灣
- 註冊時間
- 2020-7-15
- 最後登錄
- 2026-2-2
|
謝謝論壇,謝謝各位前輩
後學藉此帖學習到清單知識與字典的運用,學習方案如下,請各位前輩指教
點選清單結果:
Option Explicit
Private Sub ComboBox1_Change()
Dim A As Range, d As Object
Set d = CreateObject("Scripting.Dictionary")
With Sheets("我的知識庫")
For Each A In .Range("B4", .[B65536].End(xlUp)).SpecialCells(2)
d(A.Value) = ""
Next
ComboBox1.List = d.keys
End With
End Sub
Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'觸發ComboBox1_Change
ComboBox1.Value = "."
ComboBox1.Value = ""
End Sub |
|
|
用行動裝置瀏覽論壇學習很方便,謝謝論壇經營團隊
請大家一起上論壇來交流
|
|
|
|
|