Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Need help with macro The question is... how to run macro each time when cell changes but as result of formula calculation (mean without selection this cell) Example : I wish to run macro when value in cell A1 is changed by changing value in B1 (formula in A1 =B1) Thanks eLaCiD |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am not sure If I get your question. B1 is = the value of A1? Why would you need a macro change that? Just make sure you have automatic calculation on. -- Bearacade ------------------------------------------------------------------------ Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016 View this thread: http://www.excelforum.com/showthread...hreadid=547906 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste this code in the appropriate sheet...
Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range On Error Resume Next Set rng = Intersect(Target, Range("A1").Precedents) On Error GoTo 0 If Not rng Is Nothing Then MsgBox "Tada" End If End Sub -- HTH... Jim Thomlinson "eLaCiD" wrote: Hi Need help with macro The question is... how to run macro each time when cell changes but as result of formula calculation (mean without selection this cell) Example : I wish to run macro when value in cell A1 is changed by changing value in B1 (formula in A1 =B1) Thanks eLaCiD |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi eLaCiD,
Try something like: '============= Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range Set rng = Range("A1") If Not Intersect(rng.Precedents, Target) Is Nothing Then Call myMacro End If End Sub '<<============= --- Regards, Norman "eLaCiD" wrote in message ... Hi Need help with macro The question is... how to run macro each time when cell changes but as result of formula calculation (mean without selection this cell) Example : I wish to run macro when value in cell A1 is changed by changing value in B1 (formula in A1 =B1) Thanks eLaCiD |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi eLaCiD,
To allow for the posiibility that the range of interest does not have precedent cells, an error handler should be included - as in Jim's superior suggestion. --- Regards, Norman |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Realy fast :))
Thanks ... eLaCiD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'IF' Macro to insert cell contents to alternate cell if cell not e | Excel Worksheet Functions | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
macro to run a separate macro dependent on value in cell | Excel Programming | |||
Please help! Macro to change cell contents based on cell to the left | Excel Programming | |||
Question: Cell formula or macro to write result of one cell to another cell | Excel Programming |