我在模块中编写了一个简单的函数,如下所示:
Function allocate(ByVal pq As PriceQtyClass, ByVal al As AllocationClass) As Boolean
Dim tmpRange As Range
Dim tmpDic As Dictionary
Dim rowIndex As Integer
Set tmpDic = pq.priQtyDic
Set tmpRange = Application.ActiveCell.Offset(0, 1)
rowIndex = 1
For Each k In tmpDic
set tmpRange = k 'adding set here isnot working
rowIndex = rowIndex + 1
Next
End Function
当它转到tmpRange = k时,弹出“用户定义类型未定义”的消息!
我不知道为什么会这样,哪里出错了!
请帮忙!