Selectable Text in VBA Message Box
For this code:
msgbox "Does Control+C work on a lowly, old message box?"
you can press ctrl + c, open notepad, ctrl + v and you will get this:
---------------------------Microsoft Excel---------------------------Does Control+C work on a lowly, old message box?---------------------------OK ---------------------------
You can use an inputbox instead of a message box
inputbox "Copy the below text", "Copy Text", "Text value"
inputbox copy text
If you want text that is "selectable" then don't use MsgBox. Use a Custom form and instead of a label use a textbox. However...
Change these properties of the textbox in design mode.
- SpecialEffect - fmiSpecialEffectFlat
- BackStyle - Transparent
- Locked - True
And then use this code
Option ExplicitPrivate Sub UserForm_Initialize() Me.Caption = "Message Box" TextBox1.Text = "Hello World!"End Sub