ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   commandbutton text/assigning sounds (https://www.excelbanter.com/excel-programming/429428-commandbutton-text-assigning-sounds.html)

Bishop

commandbutton text/assigning sounds
 
My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?

Jacob Skaria

commandbutton text/assigning sounds
 
Try the below...

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Sub Macro()
sndPlaySound "C:\1.wav", 1
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?


Jacob Skaria

commandbutton text/assigning sounds
 
Use the Accelerator property of your command button and type 3.
--
If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?


Bishop

commandbutton text/assigning sounds
 
I thought about that but that requires the use of the Alt key. I have a
userform with 15 or so commandbuttons and any 10 of those will have to be
selected, say. That means I'd have to press Alt each time I want to select a
button. I wanted to stick with the ability to just press a single key (like
the code you suggested yesterday) to make the userform more efficient.

"Jacob Skaria" wrote:

Use the Accelerator property of your command button and type 3.
--
If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?


Jacob Skaria

commandbutton text/assigning sounds
 
Hi Bishop

I remember. Then why dont you try Keycode itself. Check the 2nd reply to
your previous post.

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

I thought about that but that requires the use of the Alt key. I have a
userform with 15 or so commandbuttons and any 10 of those will have to be
selected, say. That means I'd have to press Alt each time I want to select a
button. I wanted to stick with the ability to just press a single key (like
the code you suggested yesterday) to make the userform more efficient.

"Jacob Skaria" wrote:

Use the Accelerator property of your command button and type 3.
--
If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?


Bishop

commandbutton text/assigning sounds
 
Yep, I just saw that. I'll read up on it and see if that works. thanks again

"Jacob Skaria" wrote:

Hi Bishop

I remember. Then why dont you try Keycode itself. Check the 2nd reply to
your previous post.

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

I thought about that but that requires the use of the Alt key. I have a
userform with 15 or so commandbuttons and any 10 of those will have to be
selected, say. That means I'd have to press Alt each time I want to select a
button. I wanted to stick with the ability to just press a single key (like
the code you suggested yesterday) to make the userform more efficient.

"Jacob Skaria" wrote:

Use the Accelerator property of your command button and type 3.
--
If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

My first question: Can I underline just one letter in a word on a
commandbutton? So say I have the word "PG-13" and I just want the 3
underlined. Is this possible?

Second question: Can I assign a .wav (or similar soundbit) to a button so
that when the button is pushed or activated that sound will play?



All times are GMT +1. The time now is 08:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com