office交流網(wǎng)--QQ交流群號及微信交流群

Access培訓(xùn)群:792054000         Excel免費交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請用微信掃碼)

        

VBA字典dictionary的Exists方法示例

2020-04-21 08:00:00
zstmtony
原創(chuàng)
16021
Exists方法:object.Exists(key)

如果 Dictionary 對象中存在所指定的關(guān)鍵字則返迴 true,否則返迴 false。


示例 如下:


Dim d
Dim strMsg As String  

   Set d = CreateObject("Scripting.Dictionary")

   d.Add "a", "www.access-cn.com"  

   d.Add "b", "m.mzhfr.cn"

   d.Add "c", "www.excel-cn.com"

   If d.Exists("c") Then

      strMsg = "指定的關(guān)鍵字已經(jīng)存在。"

   Else

      strMsg = "指定的關(guān)鍵字不存在。"

   End If
分享
文章分類
聯(lián)繫我們
聯(lián)繫人: 王先生
Email: 18449932@qq.com
QQ: 18449932
微博: officecn01
移動訪問