我有以下的僞數據創建值和密鑰列表,並獲得最大值
Dim count1 As Integer
Dim count2 As Integer
Dim count3 As Integer
Dim count4 As Integer
Dim count5 As Integer
count1 = 0
count2 = 3
count3 = 2
count4 = 0
count5 = 1
使用下面的代碼我的值添加到字典
Dim key As Variant
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
dic.Add "Category 1", count1
dic.Add "Category 2", count2
dic.Add "Category 3", count3
dic.Add "Category 4", count4
dic.Add "Category 5", count5
我想但現在要做的是獲得屬於最高計數的類別(在本例中爲 類別2)。有關如何提取此值的任何想法?
歡迎SO。請閱讀[如何問](http://stackoverflow.com/help/how-to-ask)。簡而言之,您需要顯示您的代碼嘗試解決此問題,以及它無法獲得最多幫助的位置在這個網站上。如果您還張貼了您的工作表樣本的屏幕截圖,那也可以幫助我們更好地幫助您。 – Moosli
@Moosli,好的,請記住。更新我的問題 –