Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trigger Macro on change in cell value
In my data validation I put the minimum and maximum values in the
spreadsheet rather than hard code them. The problem is if the end user changes the minimum or maximum value I want to run a macro to reset the messages to be displayed by the data validation message box. What I want to do is trigger the macro if either value changes. Cell M8 holds the minimum, N8 holds the maximum value. Value is integer. So if either of these numbers are change, how do I automatically run my macro? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trigger Macro on change in cell value
Use the Worksheet_Change() event macro. See
http://cpearson.com/excel/events.htm In article , "qwerty" wrote: In my data validation I put the minimum and maximum values in the spreadsheet rather than hard code them. The problem is if the end user changes the minimum or maximum value I want to run a macro to reset the messages to be displayed by the data validation message box. What I want to do is trigger the macro if either value changes. Cell M8 holds the minimum, N8 holds the maximum value. Value is integer. So if either of these numbers are change, how do I automatically run my macro? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trigger Macro on change in cell value
OK - works perfectly for one cell. What is the most efficient way for
multiple cells? "JE McGimpsey" wrote in message ... Use the Worksheet_Change() event macro. See http://cpearson.com/excel/events.htm In article , "qwerty" wrote: In my data validation I put the minimum and maximum values in the spreadsheet rather than hard code them. The problem is if the end user changes the minimum or maximum value I want to run a macro to reset the messages to be displayed by the data validation message box. What I want to do is trigger the macro if either value changes. Cell M8 holds the minimum, N8 holds the maximum value. Value is integer. So if either of these numbers are change, how do I automatically run my macro? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trigger Macro on change in cell value
Depends -
If the same action will occur for all cells, one way: Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If Not Intersect(.Cells, Range("A1, B2")) Is Nothing Then 'do stuff here End If End With End Sub If different things should occur when each cell is changed, one way: Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target Select Case .Cells.Address(False, False) Case "A1" 'Do A1 Stuff Case "B2" 'Do B2 Stuff Case Else 'Do Nothing End Select End With End Sub In article , "qwerty" wrote: OK - works perfectly for one cell. What is the most efficient way for multiple cells? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trigger Event on Format Change | Excel Discussion (Misc queries) | |||
Cell change to trigger Macro | Excel Programming | |||
Cell value change to trigger macro (worksheet change event?) | Excel Programming | |||
Trigger an event on Checkbox change | Excel Programming |