Excel表格匹配工具问题

excel宏问题遇到的现象和发生背景

代码无法运行匹配

问题相关代码

Public g As Object
Public Sub test()
t1 = Timer
Set g = New 类1
Sheets("表1").Select
r = Range("a1", Cells(Rows.Count, 1).End(3)) 'a列 的数据赋值给数组r
For i = 1 To UBound(r)
r(i, 1) = Look(r(i, 1)) '开始查找,找到的数据赋值给新的数组
Next
Range("b1:b" & Cells(Rows.Count, 1).End(3).Row) = r '将查找出的结果写入到B列
'Call test1 '匹配多列时就多写几个子类模块
Set g = Nothing
Set d = Nothing
t2 = Timer
MsgBox "总共用时" & Format(t2 - t1, "0.00秒")
End Sub
Public Function Look(S)
Look = g.d(S) '自定义查找函数
End Function

img