[英]Options of message box in Excel
我們想要更改消息框中顯示的文本的字體,顏色和大小。
可以/如何VBA?
沒有嘗試,我們在包括Microsoft幫助站點在內的在線手冊中找不到任何幫助。
我們希望使消息框更大,更大膽且更大聲。
簡單回答:不能。
這就是為什么您無法在MsgBox函數的官方文檔中找到任何有關它的原因。
一種解決方法是創建自己的UserForm,您可以在其中自由設置樣式。
在您的工作簿的代碼模塊中添加一個用戶窗體,並根據需要使用任意數量的Label和CommandButton控件對其進行配置。
如果標簽文本是靜態的,則可以通過IDE中的“屬性”窗口進行全部配置:
標簽,命令按鈕等是用戶窗體上可訪問的控件 ,並且可以在運行時根據需要動態更改,例如,在窗體的Initialize或Activate或任何其他事件處理程序中。 窗體上的控件甚至可以更改其他控件,例如,您可以利用命令按鈕的Click事件處理程序來修改與Label1控件關聯的文本,等等。
Initialize
Activate
Click
Label1
您甚至還可以動態添加(或刪除)控件(標簽等),並完全控制它們的外觀/格式/等。
[英]MS Excel / VB message box with multiple options
[英]Display message box in excel
[英]Disable or hide options in combo box VBA Excel
[英]VBA Excel macro message box auto close
[英]Create Message box, when cell is selected (excel)
[英]excel vba vlookup if true then message box
[英]Turn off / ignore message box's in excel
[英]Date format in a message box in Excel VBA
[英]Excel bug message box output writes on cell
[英]Sum specific values in Excel and display in Message Box?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.