No announcement yet.

VBA: How to change the font type & size?

  • Filter
  • Time
  • Show
Clear All
new posts

  • VBA: How to change the font type & size?

    Hi all

    I have a question.

    I need to change the font size & type. How?

    For msgbox and msgbox function.

    1. Msgbox "Welcome"

    2. Response = Msgbox ("Want to eat lunch?", vbQuestion + vbYesNo, "Question")


    Warmest regards

  • #2
    The easiest way to see hoe to alter your font size, etc is to carry out the operation whilst recording a macro.
    'turn Font red
    Selection.Font.ColorIndex = 3

    @ change font to 12 and Arial Black
    With Selection.Font
    .Name = "Arial Black"
    .Size = 12
    End with
    Hope that Helps


    New users should read the Forum Rules before posting

    For free Excel tools & articles visit my web site

    If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need

    RoyUK's Web Site

    royUK's Database Form

    Where to paste code from the Forum

    About me.


    • #3
      does that apply to how I alter the font size for the msgbox?
      Warmest regards


      • #4
        I'm not sure you can do much with the font properties within a messagebox.

        I think that if you want something fancier than the windows default, you'll need to build userforms that act like message boxes (& which you have far greater control over formatting)....

        It's a bit like the auto-form in excel.... you can't change much of it, so if it's no good, you need to build your own...

        Hope this helps,

        Kind Regards, Will Riley

        LinkedIn: Will Riley


        • #5

          As Roy and Will have said I too have never solved font size in Message Box’s, but often I do amend things such as font and size in UserForms, you will find this is the way forward but I will never say UserForms can be the easiest development and take a few attempts to get going.

          You will need to edit and amend the Properties – UISerform window, and look under Alphabetic there you will see font settings, remember these can be over ridden with VBA Code Lines also.

          If you get such on Userforms start a new feed for the UserForm questions I and I know many of OzGrid members do use UserForms extensively. Good luck

          Kindest possible regards

          Jack in the UK


          • #6
            Some code that will on activation of a UserForm will make the font size 16

            Hope this get you started



            Private Const FS = 16

            Private Sub UserForm_Activate()
            UserForm1.TextBox1.Text = "Jack in the UK"
            UserForm1.TextBox1.FontSize = FS
            End Sub