Format pop up message

Gwill1983

Board Regular
Joined
Oct 24, 2018
Messages
123
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Is there a way of formatting a pop up box in excel?

I have created a pop up message to appear when the file is opened, but it doesn't stand out very well against the white excel sheet itself!

Just want to change the background colour of the Pop up box and the font

Any ideas?

Thanks

Chris
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
If you are talking about the inbuilt MsgBox, then formatting will not be easy, even if possible.
Your best bet would be to create your own using a UserForm
 
Upvote 0
You can change the colour of the font... try this...

<code class="language-vb" data-lang="vb" style="box-sizing: border-box; font-size: inherit; border: 0px; border-radius: 0px; background-color: transparent; padding: 0px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; color: inherit; white-space: pre;">Option Explicit

#If Win64 Then
Private Declare PtrSafe Function GetSysColor Lib "user32" _
(ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetSysColors Lib "user32" _
(ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
#Else
Private Declare Function GetSysColor Lib "user32" _
(ByVal nIndex As Long) As Long
Private Declare Function SetSysColors Lib "user32" _
(ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
#End If

Private Const COLOR_WINDOWTEXT As Long = 8
Private Const CHANGE_INDEX As Long = 1

Public Sub MsgBoxColorDemo()
Dim defaultColour As Long

'Store the default system color
defaultColour = GetSysColor(COLOR_WINDOWTEXT)

'Set system color to red
SetSysColors CHANGE_INDEX, COLOR_WINDOWTEXT, vbRed
MsgBox "Incorrect", vbCritical, "Your result is..."

'Set system color to green
SetSysColors CHANGE_INDEX, COLOR_WINDOWTEXT, RGB(0, 128, 0)
MsgBox "Correct", , "Your result is..."

'Restore default value
SetSysColors CHANGE_INDEX, COLOR_WINDOWTEXT, defaultColour

End Sub</code>
 
Upvote 0
Thanks all!

May be a little advanced for my tiny mind currently!!
 
Upvote 0

Forum statistics

Threads
1,215,766
Messages
6,126,761
Members
449,336
Latest member
p17tootie

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