ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check to see if the value is changed ... (https://www.excelbanter.com/excel-programming/378148-check-see-if-value-changed.html)

2007-User

check to see if the value is changed ...
 
Hi Guys,

I need to run a module every time the value of a range in a worksheet is
changed.
can you please show me a simple example?

Thanks.



Don Guillett

check to see if the value is changed ...
 
Here are a few
http://groups.google.com/groups?as_d...=&as_uauthors=

or tiny url

http://tinyurl.com/tfrr6

--
Don Guillett
SalesAid Software

"2007-User" wrote in message
...
Hi Guys,

I need to run a module every time the value of a range in a worksheet is
changed.
can you please show me a simple example?

Thanks.





tskogstrom

check to see if the value is changed ...
 
Put this Sub int Worksheet module and change the range to your own
needs. It start a subroutine in another module.


Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1:B10")) Is Nothing Then
Call [Name of Subroutine]
End If
End Sub

You don't need to write "Call" but I use to, because it become easier
to see when I call another routine.

Kind reagrds
Tskogstrom


2007-User skrev:

Hi Guys,

I need to run a module every time the value of a range in a worksheet is
changed.
can you please show me a simple example?

Thanks.



tskogstrom

check to see if the value is changed ...
 
- I forgot:

If you ned to check if the value actually has been changed, I use to
have a veryhidden "reference worksheet" with reference values.

When you activate Sheet1 I use Worksheet_Activate event and let
Sheet2.Range("A1").value = Sheet1.Range("A1").value. Then using
Worksheet_Change and Intersect as I just told you, you could check if
the value still is the same.

Regards
/Tskogstrom


2007-User skrev:

Hi Guys,

I need to run a module every time the value of a range in a worksheet is
changed.
can you please show me a simple example?

Thanks.




All times are GMT +1. The time now is 03:11 PM.

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