Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: how do centre and Italic the text in a msgbox? Are my

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Sydney/Brisbane , Australia
    Posts
    542
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I think the Subject explains what i want.

    Any assistance gr8ly appreciated.



    [ This Message was edited by: Qroozn on 2002-04-23 21:31 ]

    [ This Message was edited by: Qroozn on 2002-04-23 21:32 ]

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,584
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi there
    Since no-one else has replied I'll pass on the little I know.
    I think text format for message boxes is not easy to write into a macro. You can change the font format by clicking the Start button, then Settings, Control Panel, Display, Appearance tab, Item drop down box and select Message Box. (Buttons for bold or italics are to the right of the drop down box in Windows 2000).
    You might find this formatting may also be picked up elsewhere in your spreadsheet besides message box.
    The only way I know to centralise is trial and error using spaces at the beginning of the text. You can break the text into separate lines using "& vbCrLf &"

    regards
    Derek

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Cape Town,South Africa
    Posts
    234
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I did this last week with somebody *?*
    Can you check the archives please,it should be there.
    the best of luck to you



  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,584
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Alternativelly you might try something like this, using a text box:

    ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 192.75, 75.75, _
    239.25, 140.25).Select
    Selection.Characters.Text = "Message Box" & Chr(10) & "" & Chr(10) & "Save this file before exiting."
    Selection.HorizontalAlignment = xlCenter
    Selection.ShapeRange.ScaleHeight 0.58, msoFalse, msoScaleFromTopLeft
    Selection.Characters.Text = "Message Box" & Chr(10) & "" & Chr(10) & "Save this file before exiting."
    With Selection.Characters(Start:=1, Length:=13).Font
    .Name = "Georgia"
    .FontStyle = "Bold"
    .Size = 20
    .ColorIndex = 3
    End With
    With Selection.Characters(Start:=14, Length:=30).Font
    .Name = "Monotype Corsiva"
    .FontStyle = "Bold"
    .Size = 14
    .ColorIndex = xlAutomatic
    End With
    Selection.ShapeRange.Fill.PresetTextured msoTextureBouquet
    Application.Wait Now + TimeValue("00:00:05")
    Selection.Delete
    Range("A1").Select
    End Sub

    regards
    Derek


    [ This Message was edited by: Derek on 2002-04-24 00:32 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •