Results 1 to 4 of 4

Carriage Return in msgbox/inputbox

This is a discussion on Carriage Return in msgbox/inputbox within the Excel Questions forums, part of the Question Forums category; Dear all, Parry, thanks for your help on my earlier query. The code is working flawlessly. I experimented for a ...

  1. #1
    Board Regular
    Join Date
    Feb 2004
    Posts
    198

    Default Carriage Return in msgbox/inputbox

    Dear all,

    Parry, thanks for your help on my earlier query. The code is working flawlessly. I experimented for a bit with userforms, but I think spoonfeeding the user with one question at a time is the best course.

    I did come across one minor problem. I have several msgboxes and/or inputboxes that come out in a poor format. example:

    InputBox("What Type of Transaction do you wish to enter? (OE: Addition or Withdrawl from the Business, PMT: A Payment to the principle lender; MBNA, or CLS: A Journal entry to close the Accounting Period.)")

    The inputbox is formatted as follows:

    What Type of Transaction do you wish to enter? (OE: Addition or Withdrawl from the Business, PMT: A Payment to the principal lender; MBNA, or CLS: A Journal entry to close the Accounting Period.

    I would like to find a way to format it as follows:

    What type of Transaction do you wish to enter?

    * OE: Addition or withdrawl from the Business
    * PMT: A Payment to the principal lender
    * CLS: A Journal Entry to close the Accounting Period.

    Is there a way to enter a carriage return in msgbox/inputboxes?

  2. #2
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    26,996

    Default Re: Carriage Return in msgbox/inputbox

    vbCrLF will create a carriage return in Message Boxes and Input Boxes, i.e.

    MsgBox "*Message Line 1" & vbCrLf & "*Message Line 2"
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    Board Regular Iridium's Avatar
    Join Date
    Jul 2002
    Location
    West Bridgford, Notts., England
    Posts
    2,834

    Default Re: Carriage Return in msgbox/inputbox

    Check out 'Miscellaneous Constants' in the VBE help...
    Iridium


  4. #4
    Board Regular
    Join Date
    Feb 2004
    Posts
    198

    Default Re: Carriage Return in msgbox/inputbox

    This is great. I printed myself a copy of the miscellaneous constants for future reference.

    You guys are awesome.

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
  •  


DMCA.com