返回列表 上一主題 發帖

製作清單

  1. Sub test()
  2.     Dim mainRowCnt, subRowCnt, extRowCnt
  3.     extRowCnt = 1
  4.     Dim rng As Range
  5.     Set rng = Range(Range("A2"), Range("B2").End(xlDown))
  6.     For mainRowCnt = 1 To rng.Rows.Count
  7.         For subRowCnt = 1 To rng.Cells(mainRowCnt, 2)
  8.             Range("C1").Offset(extRowCnt, 0) = rng.Cells(mainRowCnt, 1)
  9.             Range("C1").Offset(extRowCnt, 1) = subRowCnt
  10.             extRowCnt = extRowCnt + 1
  11.         Next
  12.     Next
  13.    
  14. End Sub
複製代碼
懂得發問,答案就會在其中

今日の一秒は  明日にない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        靜思自在 : 得理要饒人,理直要氣和。
返回列表 上一主題