VBA Notification pop up

harryax7

New Member
Joined
Jul 4, 2022
Messages
8
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
hello, how i add sound notification in my code please help me
VBA Code:
Private Sub Workbook_Open()
Dim r As Range

For Each r In Range("F4:F10")
    If r.Value = Date Then
    
MsgBox ("Hallo Admin "), vbInformation

End If
Next r
End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Welcome to the MrExcel board!

Is this what you mean?

VBA Code:
Private Sub Workbook_Open()
  Dim r As Range
  
  For Each r In Range("F4:F10")
    If r.Value = Date Then
      Beep
      MsgBox ("Hallo Admin "), vbInformation
    End If
  Next r
End Sub
 
Upvote 0
Welcome to the MrExcel board!

Is this what you mean?

VBA Code:
Private Sub Workbook_Open()
  Dim r As Range
 
  For Each r In Range("F4:F10")
    If r.Value = Date Then
      Beep
      MsgBox ("Hallo Admin "), vbInformation
    End If
  Next r
End Sub
Thankyou, just that sound ora any sound i can use it? ora we can custom like voice custom maybe?
 
Upvote 0
1657010622784.png

now my excel has notification like that, any suggestion please?
 
Upvote 0
VBA Code:
For Each r In Range("f4:f10")
    If r.Value = Date Then
        Application.Speech.Speak ("Hello! cell " & r.Address(0, 0) & " contains today's date")
    End If
Next r
Cool Dude, how to speak other language, i mean other voice language?
 
Upvote 0
Do you mean different voices, e.g. male, female?

You can test what's available in your version of Windows, using:

VBA Code:
Sub Test()

    Dim vc As SpVoice
    Dim i As Long
    
    Set vc = New SpVoice
        
    For i = 0 To vc.GetVoices.Count - 1
        Set vc.voice = vc.GetVoices.Item(i)
        vc.Speak "Hello!"
    Next

End Sub

First, you'll need to set a VBA reference to the Microsoft Speech Object Library (you may have two of these) that contains sapi.dll.

1657014064564.png
 
Upvote 0
Do you mean different voices, e.g. male, female?

You can test what's available in your version of Windows, using:

VBA Code:
Sub Test()

    Dim vc As SpVoice
    Dim i As Long
   
    Set vc = New SpVoice
       
    For i = 0 To vc.GetVoices.Count - 1
        Set vc.voice = vc.GetVoices.Item(i)
        vc.Speak "Hello!"
    Next

End Sub

First, you'll need to set a VBA reference to the Microsoft Speech Object Library (you may have two of these) that contains sapi.dll.

View attachment 68636
i mean speak our language, not default english
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
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