ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting MsgBox Text (https://www.excelbanter.com/excel-programming/332068-formatting-msgbox-text.html)

davidm

Formatting MsgBox Text
 

Can someone get this to work: Text is supposed to be formatted *Max*imum
value required with only "Max" bolded.

Sub FormatText()
msg = "Maximum value required"
txt = msg.Characters(Start:=1,Length:=3).Font.Bold
Msgbox txt
End sub

TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=379982


mangesh_yadav[_333_]

Formatting MsgBox Text
 

Hi David,

Though I don;t know if this is possible in a msgbox, I can tell you th
reason why your code is not working. You have set msg as "your string"
And then you are try to set the characters for the msg a
msg.character. This you can do on objects only, and need to set th
text as object.

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37998


Nigel

Formatting MsgBox Text
 
AFAIK you cannot format the text in a message box using VBA. Suggest you
create a custom userform to simulate the msgbox and add a function to
control it.

I recall that John Walkenbach refers to this approach but could not find the
reference on his site, have a look here ...
http://j-walk.com/ss/excel/index.htm

--
Cheers
Nigel



"davidm" wrote in
message ...

Can someone get this to work: Text is supposed to be formatted *Max*imum
value required with only "Max" bolded.

Sub FormatText()
msg = "Maximum value required"
txt = msg.Characters(Start:=1,Length:=3).Font.Bold
Msgbox txt
End sub

TIA


--
davidm
------------------------------------------------------------------------
davidm's Profile:

http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=379982





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

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