Sub Test()
'
Dim TestValue As Long
'
TestValue = 5
'
If TestValue = 5 Then
'
'-----------------------------------------------------------------------------------
' Message box section
'-----------------------------------------------------------------------------------
With Form_MessageBox
.BackColor = RGB(0, 0, 255) ' Background color of Message box ... RGB(0, 0, 255) = Blue
.BorderColor = RGB(0, 0, 0) ' Set border color ... RGB(0, 0, 0) = Black
.Caption = Space(110) & "Title of Message Box" ' Title for the Message box ... Space command used for centering
'
'-----------------------------------------------------------------------------------
' Text message section
'-----------------------------------------------------------------------------------
With .LabelMessage
.BackColor = RGB(255, 255, 255) ' Background color of test message area ... RGB(255, 255, 255) = White
.Caption = "This is the first line of text." _
& vbLf & "This is a second line, if needed, etc." ' Message(s) to display in the Message area
.Font = ArialBlack ' Font for Message area
.Font.Bold = True '
.Font.Size = 36 ' Set how big you want the text to be
End With
'-----------------------------------------------------------------------------------
.Height = .LabelMessage.Height + 70 ' Height of Message box
.Width = .LabelMessage.Width + 30 ' Width of Message box
'-----------------------------------------------------------------------------------
With .cmdOK
.Top = .Parent.LabelMessage.Top + .Parent.LabelMessage.Height + 15
.Left = .Parent.Width - (.Parent.Width / 2) - 21
End With
'
.Show ' Show the Message box
End With
End If
End Sub