- 帖子
- 4901
- 主題
- 44
- 精華
- 24
- 積分
- 4916
- 點名
- 62
- 作業系統
- Windows 7
- 軟體版本
- Office 20xx
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台北
- 註冊時間
- 2010-4-30
- 最後登錄
- 2025-3-13
               
|
回復 7# myleoyes - Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim ar()
- If Target.Address <> "$L$2" Then Exit Sub
- x = InputBox("輸入數字", , [AA1])
- y = InputBox("輸入次數", , 3)
- Do Until x = "" Or y = ""
- For i = 1 To y
- ReDim Preserve ar(s)
- ar(s) = x
- If s = Application.Max([A:A]) Then GoTo 10
- s = s + 1
- Next
- x = InputBox("輸入數字", , 123)
- y = InputBox("輸入次數", , 3)
- Loop
- 10
- Range([L3], Cells(Rows.Count, 1).End(xlUp).Offset(, 11)) = ""
- If s > 0 Then [L3].Resize(s, 1) = Application.Transpose(ar)
- End Sub
複製代碼 |
|