返回列表 上一主題 發帖

[發問] 簡化CommandButton

[發問] 簡化CommandButton

Private Sub CommandButton1_Click()
CommandButton1.Enabled = False
Range("N3") = Date
End Sub
Private Sub CommandButton2_Click()
CommandButton2.Enabled = False
Range("N4") = Date
End Sub
一直到
Private Sub CommandButton98_Click()
CommandButton98.Enabled = False
Range("N100") = Date
End Sub
請問有辦法簡化嗎?謝謝大大們

當同事填寫資料完成,就按紐記錄日期,用來計算處理時間

TOP

Private Sub CommandButton_Click()
On Error Resume Next
Dim i As Integer
For i = 3 To 100
If CommandButton & i = False Then
Cells(i, 10) = Date
End If
Next
End Sub
自己亂寫的,想讓大家了解,大概就是這樣的模式,謝謝

TOP

        靜思自在 : 人事的艱難與琢磨,就是一種考驗。
返回列表 上一主題