Hi guys, I need help which a vba code to make excel automatically run a macro when I change a value in any cell of a specific column. I have come up a modification of the following code which is not working:
19 = target column
testing spreadsheet = spreadsheet in question
Refreshfilter = macro to run
Private Sub Status_Change(ByVal Target As Range)
Dim oldVal As String
Dim newVal As String
If Target.Count > 1 Then Exit Sub
If Target.Column = 19 Then
'If Target.Column <> 100 Then
newVal = Target.Value
If newVal <> "" Then
Application.EnableEvents = False
Application.Undo
Application.Run "'testing spreadsheet'!Refreshfilter"
Else
End If
Application.EnableEvents = True
End If
End If
End Sub
Thanks in advance.
19 = target column
testing spreadsheet = spreadsheet in question
Refreshfilter = macro to run
Private Sub Status_Change(ByVal Target As Range)
Dim oldVal As String
Dim newVal As String
If Target.Count > 1 Then Exit Sub
If Target.Column = 19 Then
'If Target.Column <> 100 Then
newVal = Target.Value
If newVal <> "" Then
Application.EnableEvents = False
Application.Undo
Application.Run "'testing spreadsheet'!Refreshfilter"
Else
End If
Application.EnableEvents = True
End If
End If
End Sub
Thanks in advance.