Consulting

Results 1 to 10 of 10

Thread: Centering Text in a Message Box

  1. #1

    Centering Text in a Message Box

    really simple question.

    Can I centre the text in a standard msgbox or do I have to produce a userform to have centered text?

    If the former is possible how do i do this?

    Thanks in advance

    PS Sorry for the spelling mistake in the title!

  2. #2
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    I think you can do it using windows hooks, but it's probably easier to create your own userform.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Fair enough, I shall create a userform then, which should nicely keep me occupied till tea time.

    By the way, I have no idea what windows hooks are, do you have time for a quick explination?

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    spelling in title corrected.
    You can edit your own thread and change the title I think.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    There's a very good and, as it happens, on-topic explanation here
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    Rory: thanks for the link am reading it now (or will be when I've finished writing this.

    Lucas: Thanks for changing the title, have figured out how to edit the post itself but couldn't see how to edit the title, so thanks

  7. #7
    I "know" Colo has some code to centre (spelling is correct so please leave it !) text in message boxes, I seem to recall it uses fonts and places text temporarily in a cell to get the required spacings, go to JMT at http://www.puremis.net/excel/cgi-bin/yabb/YaBB.pl and look in the addins section.
    2+2=9 ... (My Arithmetic Is Mental)

  8. #8
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    spelling is wrong and it's the wrong color
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  9. #9
    It's not coloured it's in plain Aluminium finish !
    2+2=9 ... (My Arithmetic Is Mental)

  10. #10
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    good one...
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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