Código:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Para usarla solo poner en cualquier parte de tu código:
Beep 150,50
Así de facil!
Os dejo unos ejemplos hechos por mí:
Código:
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
For i = 1 To 5
Beep 700 * i, 450
Next i
End Sub
Private Sub Command2_Click()
Beep 4000, 3000
End Sub
Private Sub Command3_Click()
For i = 1 To 30
Beep 2 ^ i, 100
Next i
End Sub
Private Sub Command4_Click()
For x = 4 To 10
For y = 1 To 50
Beep x * (y + x), 5 + x
Next y
Next x
Beep 2000, 500
End Sub
Private Sub Command5_Click()
For x = 1 To 450
s = Round(x Mod 5)
Beep s * x, 30
Next x
End Sub
Private Sub Command6_Click()
Randomize
For x = 1 To 10
num = Int(Rnd * 1000) + 100
dur = Int(Rnd * 100) + 50
Beep num, dur
Next x
End Sub
Y como siempre el código adjunto al post, saludos!!