ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running a macro when a cell value changes (https://www.excelbanter.com/excel-programming/304613-running-macro-when-cell-value-changes.html)

Emea training[_2_]

Running a macro when a cell value changes
 
How can I run a macro called "sounds", when a value within a spreadshee
ie: cell A1 goes over a pre-defined value, located in another cell (sa
a2)?

I have tried but am failing

--
Message posted from http://www.ExcelForum.com


Don Guillett[_4_]

Running a macro when a cell value changes
 
Norm,
:You may want to check your system clock unless xmas is already passed for
you.

--
Don Guillett
SalesAid Software

"Norman Jones" wrote in message
...
Hi Emea,

If the Sounds macro is in a standard module in the workbook,

Right-click the worksheet tab, select View Code and paste the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("A1"), Target) Is Nothing Then
If Range("A1").Value Range("A2").Value Then
Sounds
End If
End If
End Sub

---
Regards,
Norman


"Emea training " wrote in
message ...
How can I run a macro called "sounds", when a value within a spreadsheet
ie: cell A1 goes over a pre-defined value, located in another cell (say
a2)?

I have tried but am failing!


---
Message posted from
http://www.ExcelForum.com/






Norman Jones

Running a macro when a cell value changes
 
Hi Don,

"Don Guillett" wrote:
:You may want to check your system clock unless xmas is already passed for
you.


Thank you .

A couple of weeks back my clock was off for a couple of hours - the result
of some injudicious system experimentation.

As for Xmas, I find that it has (almost) always passed for me!


---
Regards,
Norman



Norman Jones

Running a macro when a cell value changes
 
Hi Emea,

If the Sounds macro is in a standard module in the workbook,

Right-click the worksheet tab, select View Code and paste the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("A1"), Target) Is Nothing Then
If Range("A1").Value Range("A2").Value Then
Sounds
End If
End If
End Sub

---
Regards,
Norman


"Emea training " wrote in
message ...
How can I run a macro called "sounds", when a value within a spreadsheet
ie: cell A1 goes over a pre-defined value, located in another cell (say
a2)?

I have tried but am failing!


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 10:11 AM.

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