|
发表于 2017-6-21 13:59
|
显示全部楼层
本楼为最佳答案
- Sub test()
- With Worksheets(1).Range("a1:i6")
- Set c = .Find([e16].Value, LookIn:=xlValues)
- If Not c Is Nothing Then
- firstAddress = c.Address
- Do
- s = s & "," & Cells(1, c.Column)
- Set c = .FindNext(c)
- Loop While Not c Is Nothing And c.Address <> firstAddress
- End If
- ar = Split(Right(s, Len(s) - 1), ",")
- Range("h16").Resize(, UBound(ar) + 1) = ar
- End With
- End Sub
复制代码 |
|