Highlight Duplicates with a keyboard long beep

thomasr79

New Member
Joined
May 17, 2007
Messages
24
Hi,

With my basic knowledge (if called that), I have a worksheet which uses:

VBA code for column A to enter the date and time automatically when data is entered in to column B.

Column B is read in from a barcode reader and font changes to red when a duplicate is read in.

Column C is blank and using conditional formatting fills the cell red when finds a duplicate.

However, I would like to:

Highlight the Duplicates the same as above but with a long keyboard beep. I don't think I can add the beep without VBA so could someone give me the full vba code to make the above happen?

Thanks in advance! this is by far the most useful excel site I found (as a novice)
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Method 1
I think you will find it easier to just put in multiple Beep lines. eg :-
Code:
Beep
Beep
Beep


Method 2
This is the API method, but it seems only to use the PC internal speaker.
Code:
Declare Function Beep Lib "kernel32" _
    (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
'===============================
'- BEEP
'===============================
Sub MyBeep()
    '- Beep Frequency, Duration
       Beep 1500, 1000
End Sub
'================================

Method 3
There is an API method to enable a sound file to be played as used by Windows (eg. .wav files). This is faily complicated. As this plays any .wav file it can be used for music too.

Do a search for Private Declare Function PlaySound Lib "WINMM.DLL"
 
Upvote 0

Forum statistics

Threads
1,214,528
Messages
6,120,064
Members
448,941
Latest member
AlphaRino

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