技術(shù) 點(diǎn)
- 技術(shù)
- 點(diǎn)
- V幣
- 點(diǎn)
- 積分
- 22723

|
6#
發(fā)表于 2016-7-17 17:03:36
|
只看該作者
Roy,下次這種要祭出代碼的,就不要拿出來(lái)顯擺了,Access有VBA,難道Excel沒(méi)有VBA么?
- Sub Sample()
- Dim MyRow As Long, i As Long
- Dim MyFind As Range
- Range("d1:e1") = Range("a1:b1").Value
- i = 1
- For MyRow = 2 To 28
- Set MyFind = Range("d:d").Find(Cells(MyRow, 1), , , xlWhole)
- If MyFind Is Nothing Then
- i = i + 1
- Cells(i, 4) = Cells(MyRow, 1)
- Cells(i, 5) = Cells(MyRow, 2)
- Else
- Cells(MyFind.Row, 5) = Cells(MyFind.Row, 5) & ";" & Cells(MyRow, 2)
- End If
- Next
- Set MyFind = Nothing
- End Sub
復(fù)制代碼 |
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒(méi)有帳號(hào)?注冊(cè)
x
|