run a macro when I change/update the value in a cell

SKooLZ

New Member
Joined
Oct 7, 2014
Messages
30
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.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Looks like you have changed the name of the "Worksheet_Change" procedure to "Status_Change" hence it will not be recognized as an event. Try placing your code in the "Worksheet_Change" event.
 
Upvote 0
Great, Gary, thanks, thats sorted it out!

The more I learn more about Excel, the more I realise that there's more to learn!!
 
Upvote 0

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top