Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Formatting text differently within a Msgbox

Thanks to Herald for his previous help! I wanted to know if it was possible
to format text within a Msgbox differently -- ie -- the first line below I'd
like to have a font of 20 with the text bolded. The other lines I'd like to
have at a font of 12 with no bolded text. Is it possible to do this? Thanks!

MsgBox "INTERMOD CALC" & vbNewLine & _
" " & vbNewLine & _
"Spreadsheet creator: Robert" & vbNewLine & _
" " & vbNewLine & _
"Chief Project Advisor: Lisa" & vbNewLine & _
" " & vbNewLine & _
"Beta Testers: Richard, Lisa," & vbNewLine & _
"George, Kelly, Michael,"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Formatting text differently within a Msgbox

I do not think you can change fonts and stuff of messagebox text. Maybe with
a Win API call, not through Excel. If you were to put these items in a cell,
yes, you could change a cell's appearance mid-cell.


Sub Macro4()
'Example turns any code after a linebreak to red size 14 bold
'Note: Need to define MyRange as something
'Also, this assumes only one linebreak, you would need
'Special parsing routine to change text in between more
'than one line break

Dim Cell As Range
For Each Cell In Selection
If InStr(Cell.Value, Chr(10)) 0 Then
With Cell.Characters _
(Start:=InStr(Cell.Value, Chr(10)) + 1, _
Length:=Len(Cell.Value) - _
InStr(Cell.Value, Chr(10))).Font
.Size = 14
.ColorIndex = 3
.Bold = True
End With
End If
Next Cell
End Sub




"Linking to specific cells in pivot table"
crosoft.com wrote in
message ...
Thanks to Herald for his previous help! I wanted to know if it was
possible
to format text within a Msgbox differently -- ie -- the first line below
I'd
like to have a font of 20 with the text bolded. The other lines I'd like
to
have at a font of 12 with no bolded text. Is it possible to do this?
Thanks!

MsgBox "INTERMOD CALC" & vbNewLine & _
" " & vbNewLine & _
"Spreadsheet creator: Robert" & vbNewLine & _
" " & vbNewLine & _
"Chief Project Advisor: Lisa" & vbNewLine & _
" " & vbNewLine & _
"Beta Testers: Richard, Lisa," & vbNewLine & _
"George, Kelly, Michael,"



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditionally formatting numeric data and text differently Albannach Excel Worksheet Functions 1 January 20th 10 02:18 AM
Conditionally formatting text and numbers differently Albannach Excel Discussion (Misc queries) 1 January 13th 10 01:06 PM
Conditional Formatting - Code to colour 3+ text values differently AK9955 Excel Discussion (Misc queries) 3 November 9th 09 06:11 PM
Missing text and/or prints differently from screen linko Excel Discussion (Misc queries) 0 April 16th 07 06:52 PM
identify numbers and text differently in formula widman Excel Discussion (Misc queries) 3 November 14th 06 04:28 PM


All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"