excel怎样取sheet1 A1列的数字 让sheet2中A列对应产生相应的行数填充sheet1 $B1内容 sheet1 A2类推sheet1A B1 3 a2 2 b3 4 csheet2A 1 a2 a3 a4 b5 b6 c7 c8 c9 c其中sheet1中A列的中的数字大小不定且没有规律 怎样让she

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/06 13:19:54
excel怎样取sheet1 A1列的数字 让sheet2中A列对应产生相应的行数填充sheet1 $B1内容 sheet1 A2类推sheet1A B1 3 a2 2 b3 4 csheet2A 1 a2 a3 a4 b5 b6 c7 c8 c9 c其中sheet1中A列的中的数字大小不定且没有规律 怎样让she
xR[OA+_Hct $KI_ X ȣx)T**@`hٙaf6C9#1LRĵ勤~e d?+mt '6PBn6H4~}kAyTZ5;0U.RBx|[4PM|8D& 2 )% srݜN]r7eP87gy,crKPAh]`y BaBID{ޚIݺ'+?SY*;K~o2{Ia$^y/vUqk)|PszImZN5H-,zGt-9>t)9TZԣ&tbvzMzUgÔ`i-r&Q,n FJ-w›O)*@+x9gV/n6$O(ҝ1gq3Xf%4Hy\Ʊ:]0|YC#P$ASV|bFƂ(K@{I=A

excel怎样取sheet1 A1列的数字 让sheet2中A列对应产生相应的行数填充sheet1 $B1内容 sheet1 A2类推sheet1A B1 3 a2 2 b3 4 csheet2A 1 a2 a3 a4 b5 b6 c7 c8 c9 c其中sheet1中A列的中的数字大小不定且没有规律 怎样让she
excel怎样取sheet1 A1列的数字 让sheet2中A列对应产生相应的行数填充sheet1 $B1内容 sheet1 A2类推
sheet1
A B
1 3 a
2 2 b
3 4 c
sheet2
A
1 a
2 a
3 a
4 b
5 b
6 c
7 c
8 c
9 c
其中sheet1中A列的中的数字大小不定且没有规律 怎样让sheet2中A列显示和sheet1中A列对应个数的B中的内容

excel怎样取sheet1 A1列的数字 让sheet2中A列对应产生相应的行数填充sheet1 $B1内容 sheet1 A2类推sheet1A B1 3 a2 2 b3 4 csheet2A 1 a2 a3 a4 b5 b6 c7 c8 c9 c其中sheet1中A列的中的数字大小不定且没有规律 怎样让she
这道题目有点意思,我试了下,用VBA代码可以实现,如下
如果不知道怎么弄,留下Email我可以把Excel文件发给你.
Sub test()
Dim i As Integer,j As Integer,total As Integer
total = 1
For i = 1 To Sheet1.Range("A:A").End(xlDown).Row
j = Sheet1.Cells(i,1).Value
Sheet2.Range("a" & total & ":a" & (total + j - 1)).Value = Sheet1.Cells(i,2)
total = total + j
Next i
End Sub