ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Embedding Command Buttons in a Text box or List box (https://www.excelbanter.com/excel-programming/303385-embedding-command-buttons-text-box-list-box.html)

Lester Lee

Embedding Command Buttons in a Text box or List box
 
Hello,

Is there away to embed a command button in a textbox or list box? The
textbox or listbox acts as a message, and then the command button hides
the message once you click it. Is there another way to do this?

Thanks

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Doug Glancy

Embedding Command Buttons in a Text box or List box
 
Lester,

You could assign a macro to a text box - from the drawing toolbar - and
assign this macro to it. Put the macro in a general module and assign it by
right-clicking, as you would with a button from the Forms bar. The textbox
basically acts like a big button when you click it and the macro makes it
disappear. If you need it to be visible again, you'll need to code for
that. Change the textbox name to suit:

Sub disappearing_box
ActiveSheet.Shapes("MyTextBox").Visible = false
End Sub

hth,

Doug Glancy

"Lester Lee" wrote in message
...
Hello,

Is there away to embed a command button in a textbox or list box? The
textbox or listbox acts as a message, and then the command button hides
the message once you click it. Is there another way to do this?

Thanks

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 12:18 PM.

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