ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run on cell change macro question (https://www.excelbanter.com/excel-programming/337854-run-cell-change-macro-question.html)

RAP

Run on cell change macro question
 
I am running a macro that is triggered by a cell entry (or change). The
macro itself rounds the value entered into the cell to the next 0.5 value and
replaces it. This action of replacing the value triggers the macro to
repeat.

How do I stop it? (counter won't work because it resets to empty when macro
is re-run) OR Is there a way to set the macro to run only once, then quit?
OR Is there another way to achieve the desired result?

I also tried entering the formula directly into the entry cells on the page,
but I get a circular reference.

Thanks,
Randy

Norman Jones

Run on cell change macro question
 
Hi Randy,

Try:

Application.EnableEvents = False

'Your rounding code

Application.EnableEvents = True


---
Regards,
Norman



"RAP" wrote in message
...
I am running a macro that is triggered by a cell entry (or change). The
macro itself rounds the value entered into the cell to the next 0.5 value
and
replaces it. This action of replacing the value triggers the macro to
repeat.

How do I stop it? (counter won't work because it resets to empty when
macro
is re-run) OR Is there a way to set the macro to run only once, then
quit?
OR Is there another way to achieve the desired result?

I also tried entering the formula directly into the entry cells on the
page,
but I get a circular reference.

Thanks,
Randy




RAP

Run on cell change macro question
 
Thank you, Norman. I was THAT " " CLOSE !! I appreciate it.
Randy


"Norman Jones" wrote:

Hi Randy,

Try:

Application.EnableEvents = False

'Your rounding code

Application.EnableEvents = True


---
Regards,
Norman



"RAP" wrote in message
...
I am running a macro that is triggered by a cell entry (or change). The
macro itself rounds the value entered into the cell to the next 0.5 value
and
replaces it. This action of replacing the value triggers the macro to
repeat.

How do I stop it? (counter won't work because it resets to empty when
macro
is re-run) OR Is there a way to set the macro to run only once, then
quit?
OR Is there another way to achieve the desired result?

I also tried entering the formula directly into the entry cells on the
page,
but I get a circular reference.

Thanks,
Randy






All times are GMT +1. The time now is 06:22 AM.

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