|
こんにちは。
>コードをご教授
っていうのは、そのまま動くコードをここに書けということでしょうか。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aRow As Range, Rng As Range
Set Rng = Range("AF2:AI20000")
Set Target = Intersect(Target, Rng, Me.UsedRange)
If Target Is Nothing Then Exit Sub
With Application
.EnableEvents = False
.ScreenUpdating = False
.Interactive = False
End With
On Error GoTo Err_Handler
For Each aRow In Target.EntireRow.Rows
If WorksheetFunction.CountA(aRow.Range("AF1:AI1")) > 0 Then
aRow.Range("AE1").Value = Date
Else
aRow.Range("AE1").ClearContents
End If
Next
On Error GoTo 0
Terminate:
With Application
.EnableEvents = True
.ScreenUpdating = True
.Interactive = True
End With
Exit Sub
'---------------------------------
Err_Handler:
'エラーハンドラ
Resume Terminate
End Sub
|
|