|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub xx()
Dim d As Object
Dim ir, i, j
Dim str$
Set d = CreateObject("scripting.dictionary")
Application.ScreenUpdating = False
On Error Resume Next
Sheets("sheet1").Select
ir = Range("b65536").End(xlUp).Row
For i = 2 To ir
For j = 3 To 8
str = str & "|" & Cells(i, j)
Next
str = Mid(str, 2)
d(Cells(i, 2).Value & "") = str
str = ""
Next
Sheets("sheet2").Select
ir = Range("b65536").End(xlUp).Row
For i = 3 To ir
Range(Cells(i, 3), Cells(i, 8)) = Split(d(Cells(i, 2).Value & ""), "|")
Next
Application.ScreenUpdating = True
End Sub
[ 本帖最后由 smhf_6 于 2010-12-27 12:37 编辑 ] |
|