比如A列的值是“杭州”,“苏州”,“宁波”等;设定”杭州”、”宁波”是”浙江”的子集,“苏州”是“江苏”的子集,如何在B列对应的单元格显示对应所属的集合?(如A1为杭州,则B1为浙江)
å°±è¿ä¸ªææï¼
对ï¼å°±æ¯è¿ä¸ªææï¼æå®æ´çå¾ä¹ï¼è°¢è°¢å å¼å
追çSub æ¥æ¾()
Dim I%, K%
For K = 2 To Range("D65536").End(xlUp).Row
For I = 2 To Range("A65536").End(xlUp).Row
If InStr(Cells(K, "D"), Cells(I, "A")) > 0 Then
Cells(I, "b") = Cells(K, "E")
End If
Next
Next
End Sub