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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,215,794
Messages
6,126,940
Members
449,349
Latest member
Omer Lutfu Neziroglu

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