我怎么能得到一个固定的列中的单元格,但dynamic行,以更改何时更新相应行中的另一个单元格?

我有一组数据,我希望列AV更新单词“手动”行中对应的行进行更改。

例如:我改变了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 

尝试这个:

 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