If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Change Msgbox font colour

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-04, 04:36
cdistefano cdistefano is offline
Registered User
 
Join Date: Nov 2004
Posts: 13
Change Msgbox font colour

Hi Folks! I'm new around here and still finding my way around!
Does anybody know if there's a way of changing font color for particular pieces of text used within Msgbox. Thanks.
CD
Reply With Quote
  #2 (permalink)  
Old 11-26-04, 07:07
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
I have a feeling that you eill need to set this up as a userform rather than a messagebox

a quick test is

add a cell to A1 and Add a number format with a colour
i.e. "[Red]#,##0;[Blue]-#,##0"
and then if you try these 2 lines
Code:
    MsgBox Format(Range("A1").Text, Range("A1").NumberFormat)
    Range("A2").Formula = Format(Range("A1").Text, Range("A1").NumberFormat)
Notice how the msgbox remains black while the cell takes the colour of the range("A1")

i Moght be wrong but this is the impression i get

Dave
Reply With Quote
  #3 (permalink)  
Old 11-29-04, 04:44
jparagg jparagg is offline
Registered User
 
Join Date: Oct 2003
Posts: 17
Red face

Hi there,

It is indeed not possible to use standard msgbox for formatting any messages. I also wished to have some part of my text that appears in message box to be bold and some in different colors, but it is not possible using msgbox as internally it uses the windows api for the message box, that does not support such formatting.
You need to write your own message dialog using forms and the controls.

Regards,

jp
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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