Sub 資料() 'K2
Dim iRows%, iNum%, iI%
Dim vData, vTimes
iRows = [A65535].End(xlUp).Row
iNum = 3
vData = Application.InputBox("輸入數字", "請輸入資料", Range("AA1"), Type:=2)
Do Until vData = 0 Or vData = "" Or iNum > iRows
Range("AA1") = vData
vTimes = Application.InputBox("輸入次數", "請輸入寫入資料的次數", Type:=2)
If vTimes = 0 Or vTimes = "" Then
Exit Sub
Else
For iI = 0 To vTimes - 1
Cells(iNum + iI, 2) = vData
Next
iNum = iNum + iI
End If
If iNum <= iRows Then
vData = Application.InputBox("輸入數字", "請輸入資料", Range("AA1"), Type:=2)
End If
Loop
End Sub作者: cw3076 時間: 2011-5-25 23:49