Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro if certain cell change
Dear All,
Can we only run a macro if certain cell change? Eg. If contain for C4 change then run the macro. If yes, kindly guide me on setting up the function? Thank you. Best Regards, Kidd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro if certain cell change
One way,
Enter the following in the worksheet code window (right-click the worksheet tab and choose View code (or similar)). '---- Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$C$4" Then MsgBox "You changed " & Target.Address End If End Sub '---- HTH Anders Silvén "Kidd" skrev i meddelandet ... Dear All, Can we only run a macro if certain cell change? Eg. If contain for C4 change then run the macro. If yes, kindly guide me on setting up the function? Thank you. Best Regards, Kidd |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Macro if certain cell change
another way is
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, ActiveSheet.Range("c4")) Is Nothing Then Exit Sub 'run your code end sub -----Original Message----- One way, Enter the following in the worksheet code window (right- click the worksheet tab and choose View code (or similar)). '---- Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$C$4" Then MsgBox "You changed " & Target.Address End If End Sub '---- HTH Anders Silvén "Kidd" skrev i meddelandet ... Dear All, Can we only run a macro if certain cell change? Eg. If contain for C4 change then run the macro. If yes, kindly guide me on setting up the function? Thank you. Best Regards, Kidd . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro that will change the font of a cell if i change a value | Excel Discussion (Misc queries) | |||
Change the Color of a Cell through a Macro | Excel Discussion (Misc queries) | |||
Fire Macro from Cell Change | Excel Worksheet Functions | |||
Macro on Cell change | Excel Discussion (Misc queries) | |||
Macro to change cell color | Excel Discussion (Misc queries) |