sub pengyx()
ar=range("b2:l50")
redim br(1 to ubound(ar),1 to 1)
for i=1 to ubound(ar)
redim cr(application.max(range(cells(i+1,2),cells(i+1,"l"))))
for j=1 to ubound(ar,2)
if ar(i,j)<>"" then
if cr(ar(i,j))="" then
cr(ar(i,j))=ar(i,j)
br(i,1)=br(i,1)&cr(ar(i,j))
end if
end if
next
next
range("y2").resize(ubound(ar),1)=br
end sub
没有测试哈,试试