• Break long line of code (2003)

    Author
    Topic
    #443326

    HI all. How do I break a long line of code so I don’t have to scroll left and right to read it?

    Thanks!

    Viewing 1 reply thread
    Author
    Replies
    • #1069172

      Enter a space and an underscore character:

      ‘Very long line of code part 1 _
      Remainder of very long line (part 2)

    • #1069174

      Insert a space and an underscore then press Enter:

      MsgBox "Do you want to continue?", _
      vbQuestion + vbYesNo

      or

      Range("A4").Value = Range("A1").Value + _
      Range("A2").Value

      Indenting the second line (and subsequent ones) is not obligatory, but it makes the code easier to read.

    Viewing 1 reply thread
    Reply To: Reply #1069236 in Break long line of code (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel