VBA Code to Break a Comment into Multiple Lines
Results 1 to 5 of 5

Thread: VBA Code to Break a Comment into Multiple Lines

  1. #1
    Board Regular
    Join Date
    Dec 2016
    Posts
    172
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA Code to Break a Comment into Multiple Lines

    Thanks in advance for any solutions, suggestions or help for which I will give feedback.

    I have two questions which are similar, but not exactly the same:

    (1) How do you break a comment such as the following into multiple lines (i.e. continuation)? This is basically so I can keep it on the screen without having to scroll over to read it. When I try to do the following it gives errors.


    Code:
    MsgBox "There is an error when I try to break this comment _ 
    into multiple lines like I'm doing now. Can anyone suggest _ 
    how to fix this.
    (2) Besides breaking the comment into multiple lines, how do you do that and show hard returns in an excel box, to where the box will show something like this....I assuming it's possibly a form box?

    The following errors occurred:
    (1) Incorrect path.
    (2) Incorrect file name.

  2. #2
    MrExcel MVP shg's Avatar
    Join Date
    May 2008
    Location
    The Great State of Texas
    Posts
    21,603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    14 Thread(s)

    Default Re: VBA Code to Break a Comment into Multiple Lines

    Code:
      MsgBox "There is an error when I try to break this comment " & _
             "into multiple lines like I'm doing now. Can anyone suggest " & _
             "how to fix this."
    
      MsgBox "The following errors occurred:" & vbLf & _
             "(1) Incorrect path." & vbLf & _
             "(2) Incorrect file name."
    Last edited by shg; Jul 15th, 2019 at 03:07 PM.

  3. #3
    Board Regular
    Join Date
    Dec 2016
    Posts
    172
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Code to Break a Comment into Multiple Lines

    shg that worked perfectly! I could not find the first solution anywhere for comments. Other items, but not for comments.

    The second answer I found nowhere! Thanks my friend from the Lone Star State!

  4. #4
    MrExcel MVP shg's Avatar
    Join Date
    May 2008
    Location
    The Great State of Texas
    Posts
    21,603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    14 Thread(s)

    Default Re: VBA Code to Break a Comment into Multiple Lines

    You're welcome.

  5. #5
    Board Regular
    Join Date
    Jul 2014
    Location
    Memphis, TN
    Posts
    2,666
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default Re: VBA Code to Break a Comment into Multiple Lines

    Quote Originally Posted by OilEconomist View Post
    Thanks in advance for any solutions, suggestions or help for which I will give feedback.

    I have two questions which are similar, but not exactly the same:

    (1) How do you break a comment such as the following into multiple lines (i.e. continuation)? This is basically so I can keep it on the screen without having to scroll over to read it. When I try to do the following it gives errors.


    Code:
    MsgBox "There is an error when I try to break this comment _ 
    into multiple lines like I'm doing now. Can anyone suggest _ 
    how to fix this.
    (2) Besides breaking the comment into multiple lines, how do you do that and show hard returns in an excel box, to where the box will show something like this....I assuming it's possibly a form box?

    The following errors occurred:
    (1) Incorrect path.
    (2) Incorrect file name.
    During entry in a Cell, use ALT+ENTER to create the LF
    In a Comment Box use SHIFT+ENTER to create you LF.
    Excel 2013, 2016 with PowerBI
    Knowing that it can be done is half the battle!

Some videos you may like

User Tag List

Tags for this Thread

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
  •