|
试了下,其他不会,字典果然如此
- Public arr, brr, crr, rng As Range, ran As Range
- Public d, dd
- Sub settest()
- arr = Range("B2:C3").Value
- Set rng = Range("B2:C3")
- Let brr = arr
- Set ran = rng
- arr = Range("B6:C7").Value
- Set rng = Range("B6:C7")
- MsgBox brr(1, 1)
- MsgBox ran.Address
- End Sub
- Sub test()
- Dim i%, ar, br
- Set d = CreateObject("scripting.dictionary")
- Set dd = CreateObject("scripting.dictionary")
- ar = Array("张三", "李四", "王五", "赵六", "韩七")
- br = Array("张三三", "李四四", "王五五", "赵六六", "韩七七")
- For i = 0 To UBound(ar)
- d(ar(i)) = ar(i)
- Next
- MsgBox d(ar(0))
- Set dd = d
- d.RemoveAll
- For i = 0 To UBound(br)
- d(br(i)) = br(i)
- Next
- MsgBox dd(ar(0))
- MsgBox dd(br(0))
- d.RemoveAll
- For i = 0 To UBound(ar)
- d(ar(i)) = ar(i)
- Next
- MsgBox dd(ar(0))
- MsgBox dd(br(0))
- End Sub
复制代码 |
|