For sound:
'Public Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long 'needed for Beep with arguments.
Sub blah()
With Sheets("Sheet9").Cells(3, Columns.Count).End(xlToLeft).Offset(, 1).Resize(14) 'destination sheet, to the right of data in row 3
.Value = Sheets("Sheet1").Range("P11:P24").Value 'source sheet and range 1
.Offset(15).Value = Sheets("Sheet1").Range("AF11:AF24").Value 'source sheet and range 3
.Offset(, 1).Value = Sheets("Sheet1").Range("X11:X24").Value 'source sheet and range 2
.Offset(15, 1).Value = Sheets("Sheet1").Range("AD11:AD24").Value 'source sheet and range 4
If .Column = 5 Then
.Offset(, -1).ClearContents 'removes formulae from column D
.Offset(15, -1).ClearContents 'removes formulae from column D
End If
.Offset(, 2).FormulaR1C1 = "=RC[-2]-RC[-5]" 'add a formulae in the next column
.Offset(15, 2).FormulaR1C1 = "=RC[-2]-RC[-5]" 'add a formulae in the next column
If .Column <> 2 Then
If Application.Max(.Offset(, 2), .Offset(15, 2)) > 2000 Then
For Each cll In Union(.Offset(, 2), .Offset(15, 2)).Cells
If cll.Value > 2000 Then cll.Interior.Color = 255
Next cll
Application.ScreenUpdating = True
'choose one or more of the following:
Beep 'Beep (windows alert sound) without arguments requires the DISABLING/ABSENCE/REMOVAL of the Public Declare function at the top of the code module
' Beep 1200, 500 'Beep with arguments (frequency,duration) NEEDS the Public Declare function at the top of the code module'
' Beep 1200, 500 'Beep with arguments (frequency,duration) NEEDS the Public Declare function at the top of the code module'
Application.Speech.Speak "at least one cell has a difference over 2000"
End If
End If
End With
If UCase(Sheets("Sheet9").Range("A1").Value) <> "STOP" Then Application.OnTime Now() + TimeValue("00:01:00"), "blah"
End Sub
Note the comments in the code. The top Public Declare line is currently disabled by prefixing it with an apostrophe which reduces it to a comment.
There are many more sound possibilities, see:
https://www.ozgrid.com/forum/forum/h...ain-percentage
https://www.ozgrid.com/forum/forum/h...t-pausing-code
http://www.cpearson.com/excel/PlaySound.aspx