- 帖子
- 552
- 主題
- 3
- 精華
- 0
- 積分
- 578
- 點名
- 0
- 作業系統
- win7
- 軟體版本
- office 2010
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2015-2-8
- 最後登錄
- 2024-7-9
  
|
10#
發表於 2015-9-16 15:10
| 只看該作者
回復 9# leehom - Sub worksheet_change(ByVal Target As Range)
- If Target.Address = "$B$2" Then
- Application.EnableEvents = False
- Cells(2, Target.Column - 1) = 1
- i = Application.InputBox("How many numbers you want to add?", "Prompt", , , , , , 1) - 1
- For j = Target.Row + 1 To Target.Row + i
- Cells(j, Target.Column) = Left(Cells(j - 1, Target.Column), 5) & Right(Cells(j - 1, Target.Column), 7) + 1
- Cells(j, Target.Column - 1) = Cells(j, Target.Column - 1).Row - 1
- Next
- Application.EnableEvents = True
- End If
- End Sub
複製代碼 |
|