1
我目前正在嘗試使用腳本字典對象做一個函數。但是,它似乎並沒有工作。我是新增腳本字典對象。該函數假設檢查單元格中的數字是否爲1,9,17或25.如果它是1,9,17或25,它將返回'True',否則返回'False'。儘管有這些數字,該函數只返回False。腳本字典功能
Function checkNuminList(r As Integer)
Dim myList As Object
Set myList = CreateObject("Scripting.Dictionary")
myList.Add Key:="Num1", Item:="1"
myList.Add Key:="Num2", Item:="9"
myList.Add Key:="Num3", Item:="17"
myList.Add Key:="Num4", Item:="25"
If myList.Exists(r) Then
checkNuminList = "True"
Else
checkNuminList = "False"
End If
End Function