<p>学习下子,数组一直绕不出[em04].用字典写了个.</p><p>Sub test()<br/>Dim odic As Object<br/>Set odic = CreateObject("scripting.dictionary")<br/>Dim arow%, i%, x<br/>arow = Range("a65536").End(xlUp).Row<br/>For i = 2 To arow<br/> odic(Left(Cells(i, 1), Len(Cells(i, 1)) - 4)) = i<br/>Next i<br/> For i = 2 To arow<br/> x = odic(CStr(Cells(i, 2)))<br/> If x <> "" Then<br/> Cells(i, 3) = "有"<br/> Else<br/> Cells(i, 3) = "无"<br/> End If<br/> Next i<br/>End Sub</p>
[此贴子已经被作者于2008-12-14 18:03:35编辑过] |