Play Sound in Excel Automatically Using VBA Macro

preview_player
Показать описание

Here's the complete macro code:
Option Explicit

Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Private Sub Worksheet_Change(ByVal Target As Range)
Dim highestGST As Long

highestGST = 28

If Range("B2").Value GREATER THAN highestGST Then


End If

End Sub

Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub PlaySound()
Dim lastrow As Long, i As Long

lastrow = Application.WorksheetFunction.CountA(Sheet1.Range("B:B"))

MsgBox lastrow

For i = 2 To lastrow
Next i

End Sub

NOTE: Replace GREATER THAN with an angular sign.
Рекомендации по теме
Комментарии
Автор

Always the main man never fails : )
You are like Mike Guring Excel is Fun he never fails either
You both the best in your field

moneymachine
Автор

Thanks, its works great.

Need to play audio if value changes
How to do?

LAZARSELVA
Автор

Wow, this actually worked. Thanks so much! Subscribing.

Get_Some_Panda
Автор

How to play more sounds under more conditions??

TheMuszekOkruszek
Автор

shape perform any action for example, rotate or move with sound.
it is possible?

skilldevelopment
Автор

How about VBA code to change left/right audio balance or left and audio volume?

stanstrong
Автор

I have several macros that run 30-90 seconds. I would like to add a beep when the macro is done running, rather than staring at the screen. Is there a way to do this?

CletoClips
Автор

Nice and good idea to make some fun...

chrisk.
Автор

hi sir, is it possible to rename closed workbook sheet name thru vba (same name need to be applied for all wb)

aryklanees
Автор

If you move this excel file = you will no longer can play that sound.
Cuz you lost the sound.

Can you make the other way to put this sound inside to excel file, and then you make the script for this sound???

linaseptiani
Автор

Sir, I'm unable to understand vba. What's the best way to start from scratch.

ramneeksharma
join shbcf.ru