If two cells are different

DaleKeel

Board Regular
Joined
Sep 11, 2019
Messages
56
Office Version
  1. 2013
Platform
  1. Windows
I paste in a number in a cell that is linked to cell I4 (so that changes I4 cell's number) Then I paste the same number from a different location in another cell that is linked to cell E4. So that both cells stay the same all the time. Sometimes I do not paste in the cell that shows up in I4 or I do not paste in the number that shows up in E4 and it causes me a lot of problems when both are out of sync for very long. The pasting operation usually only takes less than 30 seconds but I do this often every workday. By having an alert that tells me "Something if Wrong" once I can correct the situation before proceeding on to the next operation. But I only need to hear it played once.

I would like to have a marco that

Any time cell I4 is different than cell E4 for 60 seconds would sound alert located in windows media folder by the name wrong.wav
Play alert only once.

Thanks much.

Dale
 
In that case try this:

Delete the 2 subs in ThisWorkbook and replace with code below
- amend "Name of Sheet"

VBA Code:
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
    If Sh.Name = "Name of Sheet" Then Call PlaySound
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Call PlaySound
End Sub

This combination should trigger
- whenever the formula in either cell is recalculated
- and whenever you move to a new cell in the workbook (providing the second warning required)
 
Last edited:
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I'm confused about the formula bit, but anyhow my thoughts were that you were running VBA many times to alert a non visible sheet. If you have two empty visible cells next to each other, them one could be =E4 and the other =Sheet(I4) and you have a direct visual comparison. adding timer loops that only occur after a time to alert you that you have a change ..........................

The lesson we all learn is to be as upfront about the requirement to start with, so that many hours aren't expended adapting to that which is stated and then rejected (the car with no wheels won't drive)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top