sub test()
dim n,m,x,y as long
dim rw() as long
dim str() as string
n=sheets(1).usedrange.rows.count
redim rw(1 to n) as long
m=1
for x= 1 to n
rw(x)=sheets(1).cells(x,"D")
str(x)=sheets(1).cells(x,"A")
for y= 1 to rw(x)
sheets(1).cells(m+y-1,"E")=str(x)
next y
m=m+rw(x)
next x
end sub
没看太明白,D1的数值为30,和样本内容心事30次的30有关吗?