我有一组数据,我希望Column AV在对应于进行更改的行的行中使用“Manual”一词进行更新。
示例:我更改Y30中的值,因此我需要AV30的值更新为“手动”。
示例:我更改了D21508中的值,因此我需要将AV21508的值更新为“手动”。
我有点生疏,但这是我到目前为止所做的:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R As Range
Set R = ActiveCell.EntireRow
If Intersect(Target, R) Is Nothing Then Exit Sub
Application.EnableEvents = False
R.Cells(1, 48).Value = "Manual"
Application.EnableEvents = True
End Sub
答案 0 :(得分:3)
试试这个:
Private Sub Worksheet_Change(ByVal Target As Range)
'change the Range in the intersect for all the column you want to check.
If Not Intersect(Target, Range("A:AU")) Is Nothing Then
Application.EnableEvents = False
Me.Cells(Target.Row, 48).Value = "Manual"
Application.EnableEvents = True
End If
End Sub