ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how do I enable marco (https://www.excelbanter.com/excel-programming/319434-how-do-i-enable-marco.html)

lmg

how do I enable marco
 
Hi all, I am trying to enable a marco when a cell = a value. the cell is
linked to DDE and changes values with a remote device. I cant use
section_change in the VBA to activate my program as the value is
automatically changing. When I configured the cell to change colour via a
formula in the excel sheet the colour changes.
It looks like I have to enable the VBA or macro in the formula bar. Can
anyone please help me with this problem on how to write the formula.
I am using excel 2000 on XP operating system.
thanks in advance
lmg

Nick Hodge

how do I enable marco
 
Img

Use a worksheet_change event rather than selection_change. This should fire
on any worksheet change. If it does not then enter a formula referring to
you 'refreshing' data and use a worksheet_calculate event

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"lmg" wrote in message
...
Hi all, I am trying to enable a marco when a cell = a value. the cell is
linked to DDE and changes values with a remote device. I cant use
section_change in the VBA to activate my program as the value is
automatically changing. When I configured the cell to change colour via a
formula in the excel sheet the colour changes.
It looks like I have to enable the VBA or macro in the formula bar. Can
anyone please help me with this problem on how to write the formula.
I am using excel 2000 on XP operating system.
thanks in advance
lmg




lmg

how do I enable marco
 
Hi Nick, thanks for the speedy response. I should have said but I also tried
worksheet_change and it still didnt work.
could you please go into more detail on the 'refresh method'
and give me an example
thanks
lmg

"Nick Hodge" wrote:

Img

Use a worksheet_change event rather than selection_change. This should fire
on any worksheet change. If it does not then enter a formula referring to
you 'refreshing' data and use a worksheet_calculate event

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"lmg" wrote in message
...
Hi all, I am trying to enable a marco when a cell = a value. the cell is
linked to DDE and changes values with a remote device. I cant use
section_change in the VBA to activate my program as the value is
automatically changing. When I configured the cell to change colour via a
formula in the excel sheet the colour changes.
It looks like I have to enable the VBA or macro in the formula bar. Can
anyone please help me with this problem on how to write the formula.
I am using excel 2000 on XP operating system.
thanks in advance
lmg





Stephen Bullen[_4_]

how do I enable marco
 
Hi Lmg,

I am trying to enable a marco when a cell = a value. the cell is
linked to DDE and changes values with a remote device.


There are (at least) three alternatives; which one to use will depend
on what you want the macro to do:

1. Use Application.OnData to run a macro every time a DDE link is
updated (See Online help for examples)

2. Use a user-defined-function, called when the cell equals the value,
but that's limited in what it can do.

3. Use the Worksheet_Calculate event to check the cell's value

Regards

Stephen Bullen
Microsoft MVP - Excel
www.oaltd.co.uk




All times are GMT +1. The time now is 05:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com