Re: [算表] VBA移除陣列中元素
各位版大好,以下有一dictionary物件,今欲將item為0之key值寫入空值,但是卻出現
dic.Item(i)非變數的錯誤訊息,不知道要如何修正,謝謝!
Function inventory_rank3(item_range As Range, number_range As Range, _
rank_order As Integer) As String
Dim r As Range
Dim ary1, ary2
Dim w&, dic, num&,
Set dic = CreateObject("scripting.dictionary")
For Each r In item_range
num = number_range.Resize(1).Offset(w)
If r <> "" Then
If dic.exists(r.Value) Then
dic.Item(r.Value) = dic.Item(r.Value) + num
Else
dic.Add r.Value, num
End If
End If
w = w + 1
Next
For Each dic.Item(i) In dic
If dic.Item(i) = 0 Then dic.Key(i) = ""
Next
End Function
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.39.49.112
※ 文章網址: https://www.ptt.cc/bbs/Office/M.1457757705.A.BF4.html
→
03/12 13:18, , 1F
03/12 13:18, 1F
→
03/12 13:30, , 2F
03/12 13:30, 2F
→
03/12 20:44, , 3F
03/12 20:44, 3F
→
03/12 20:45, , 4F
03/12 20:45, 4F
→
03/12 20:45, , 5F
03/12 20:45, 5F
→
03/12 20:46, , 6F
03/12 20:46, 6F
→
03/12 20:46, , 7F
03/12 20:46, 7F
→
03/12 20:47, , 8F
03/12 20:47, 8F
→
03/12 21:28, , 9F
03/12 21:28, 9F
→
03/12 21:28, , 10F
03/12 21:28, 10F
→
03/12 21:34, , 11F
03/12 21:34, 11F
→
03/13 17:09, , 12F
03/13 17:09, 12F
→
03/13 17:10, , 13F
03/13 17:10, 13F
→
03/13 17:11, , 14F
03/13 17:11, 14F
→
03/13 17:11, , 15F
03/13 17:11, 15F
→
03/13 17:12, , 16F
03/13 17:12, 16F
→
03/13 17:20, , 17F
03/13 17:20, 17F
→
03/13 17:21, , 18F
03/13 17:21, 18F
→
03/13 17:21, , 19F
03/13 17:21, 19F
→
03/13 20:04, , 20F
03/13 20:04, 20F
→
03/13 20:04, , 21F
03/13 20:04, 21F
→
03/13 20:05, , 22F
03/13 20:05, 22F
→
03/13 20:05, , 23F
03/13 20:05, 23F
→
03/13 20:05, , 24F
03/13 20:05, 24F
→
03/13 20:08, , 25F
03/13 20:08, 25F
→
03/13 20:10, , 26F
03/13 20:10, 26F
→
03/13 20:11, , 27F
03/13 20:11, 27F
→
03/13 20:46, , 28F
03/13 20:46, 28F

→
03/13 20:46, , 29F
03/13 20:46, 29F
→
03/14 08:34, , 30F
03/14 08:34, 30F
→
03/14 08:36, , 31F
03/14 08:36, 31F
→
03/14 08:39, , 32F
03/14 08:39, 32F
→
03/14 08:39, , 33F
03/14 08:39, 33F
→
03/14 08:54, , 34F
03/14 08:54, 34F
→
03/14 08:55, , 35F
03/14 08:55, 35F
→
03/14 08:58, , 36F
03/14 08:58, 36F
→
03/14 11:38, , 37F
03/14 11:38, 37F
討論串 (同標題文章)
Office 近期熱門文章
PTT數位生活區 即時熱門文章