Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Edit my Macro Please

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Edit my Macro Please

Here is one that I have used:

Sub MultiBeep(NumBeeps)
For Counter = 1 To NumBeeps
Beep
Run "BeepTime"
Next Counter
End Sub

You use it like a function. If you want 2 beeps then:

Sub test()
MultiBeep 2
End Sub

For three beeps

Sub test2()
MultiBeep 3
End Sub




"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Edit my Macro Please

Delete the Run BeepTime line. It refers to a delay timer that is not
included in the code I gave you.

"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Edit my Macro Please

JLGWhiz seems to have lost the "beepTime" subroutine.

Here's an alternative:

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub MultiBeep(Optional NumBeeps As Long = 1)
Dim Counter As Long
For Counter = 1 To NumBeeps
Beep
Sleep 250 'quarter of a second
Next Counter
End Sub
Sub test2()
Call MultiBeep(2)
End Sub

(With just a few changes to be irritating <vbg.)




JLGWhiz wrote:

Here is one that I have used:

Sub MultiBeep(NumBeeps)
For Counter = 1 To NumBeeps
Beep
Run "BeepTime"
Next Counter
End Sub

You use it like a function. If you want 2 beeps then:

Sub test()
MultiBeep 2
End Sub

For three beeps

Sub test2()
MultiBeep 3
End Sub

"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!




--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Edit my Macro Please

You will probably need a delay to distinguish the number of beeps, so here is
the modified sub to do that.

Sub MultiBeep(NumBeeps)
For counter = 1 To NumBeeps
Beep
s = Timer + 0.5
Do While Timer < s
DoEvents
Loop
Next counter
End Sub





"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Edit my Macro Please

And depending on the version of excel you're using and how it was installed:

Option Explicit
Sub testme()
Application.Speech.Speak "Beep, beep"
End Sub


Gerard Sanchez wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Edit my Macro Please

And to be really irritating:

Option Explicit
Sub test2()
With Application
.Speech.Speak .Rept("beep", 3)
End With
End Sub




Gerard Sanchez wrote:

'Hi,

'Currently I am using the function below to and called on whenever there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Edit my Macro Please

Question on

How to I call this, say when A1=A2?

Thanks


"Dave Peterson" wrote in message
...
JLGWhiz seems to have lost the "beepTime" subroutine.

Here's an alternative:

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub MultiBeep(Optional NumBeeps As Long = 1)
Dim Counter As Long
For Counter = 1 To NumBeeps
Beep
Sleep 250 'quarter of a second
Next Counter
End Sub
Sub test2()
Call MultiBeep(2)
End Sub

(With just a few changes to be irritating <vbg.)




JLGWhiz wrote:

Here is one that I have used:

Sub MultiBeep(NumBeeps)
For Counter = 1 To NumBeeps
Beep
Run "BeepTime"
Next Counter
End Sub

You use it like a function. If you want 2 beeps then:

Sub test()
MultiBeep 2
End Sub

For three beeps

Sub test2()
MultiBeep 3
End Sub

"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever
there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the
1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!




--

Dave Peterson



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Edit my Macro Please


:-)

Maybe Excel talking would sound funny . . .lol!



"Dave Peterson" wrote in message
...
And depending on the version of excel you're using and how it was
installed:

Option Explicit
Sub testme()
Application.Speech.Speak "Beep, beep"
End Sub


Gerard Sanchez wrote:

'Hi,

'Currently I am using the function below to and called on whenever there
is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the 1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!


--

Dave Peterson



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Edit my Macro Please

Are A1 and A2 both changed by typing?

If yes, then you could use the worksheet_Change event.

If either A1 or A2 are changed by a formula, then you could use the
worksheet_Calculate event.

But as a user, this would drive me nuts. I'd much rather see an adjacent cell
formatted in big bold letters with a formula like:

=if(a1<a2,"","Please make them different!"

Gerard Sanchez wrote:

Question on

How to I call this, say when A1=A2?

Thanks

"Dave Peterson" wrote in message
...
JLGWhiz seems to have lost the "beepTime" subroutine.

Here's an alternative:

Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub MultiBeep(Optional NumBeeps As Long = 1)
Dim Counter As Long
For Counter = 1 To NumBeeps
Beep
Sleep 250 'quarter of a second
Next Counter
End Sub
Sub test2()
Call MultiBeep(2)
End Sub

(With just a few changes to be irritating <vbg.)




JLGWhiz wrote:

Here is one that I have used:

Sub MultiBeep(NumBeeps)
For Counter = 1 To NumBeeps
Beep
Run "BeepTime"
Next Counter
End Sub

You use it like a function. If you want 2 beeps then:

Sub test()
MultiBeep 2
End Sub

For three beeps

Sub test2()
MultiBeep 3
End Sub

"Gerard Sanchez" wrote:

'Hi,

'Currently I am using the function below to and called on whenever
there is
a discrepancy between two values on an IF formula.

Function beepNow()
Beep
End Function

'I was wondering if there is a way for me to do 2 beeps aside from the
1
beep above I can call whenever certain cells changes its value.
This would be applied to the whole workbook.

'Any input would be very much appreciated!




--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Record Macro and Edit Macro options disabled Huzza New Users to Excel 1 March 18th 09 03:55 PM
Run and edit a Macro santaviga Excel Programming 1 May 1st 08 03:55 PM
how to edit a macro Daniel Excel Discussion (Misc queries) 3 December 11th 07 04:38 PM
How to edit this Macro? yhoy Setting up and Configuration of Excel 3 December 2nd 07 11:21 PM
Edit this macro Kent48[_2_] Excel Programming 0 October 3rd 04 12:33 AM


All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"