Format message box

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
780
Office Version
  1. 365
Hi,

is there anyway to format the message box like bold and colour(attached picture of msg box):

here is the code:

VBA Code:
'Add code in Sheet module
'Declaring variables
Dim intCounter As Integer
Dim txt As String

'Checking that target column should not be greater than 5
If Target.Column > 11 Then Exit Sub

Cancel = True

'Getting values of target row in string
For intCounter = 1 To 11
   txt = txt & Cells(Target.Row, intCounter) & vbLf
Next intCounter

'Displaying string message
MsgBox txt

End Sub

Thank you
 

Attachments

  • msg_box.PNG
    msg_box.PNG
    22 KB · Views: 16

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I do not think that MsgBox supports Bold Font or color change... (I might be wrong) you would be better off using a custom userform.

Getting bold font for a Msgbox might be possible but this could require API Calls and serious coding skills lol...
 
Upvote 0
I think you may have attached the wrong image.
In any event, as @Jimmypop points out, it is doable and does require API calls... but you're in luck, because one of the forum experts has recently created code (and a workbook demonstrating how to use the code) that generates colourful, custom messageboxes: Multi-Color VBA MsgBox Including Buttons ( Easy to use )
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,215,007
Messages
6,122,670
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top