+ Reply to Thread
Results 1 to 13 of 13

Line continuation

  1. #1
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Line continuation

    I am using the following formula in a macro, but it is all on one line, thus making it difficult to view. I am not sure what I am doing wrong. Being a beginner, I am likely overlooking some basic rules of thumb.

    Please help with the following:

    Please Login or Register  to view this content.
    Last edited by Wedge120; 09-06-2010 at 11:44 PM. Reason: solved

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Need line continuation help with a formula

    Try a Space Underscore and then Enter to start a continuation of a line.

    That will allow you to wrap.

  3. #3
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Need line continuation help with a formula

    I've been trying that, but I get errors . I believe there are certain places where this can be applied successfully, but not at all locations within the formula. I believe there are rules to follow, but I do not know what they are.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need line continuation help with a formula

    provide a few more lines of your code so the formula can be seen in its context, please.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Need line continuation help with a formula

    OK - I thought you were in the VBA editor and I guess you aren't.

    If you are looking at the formula bar just after Fx then put your mouse on the bar between the column letters and the function input and click and drag it down. Let me know if that was it.

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need line continuation help with a formula

    Marvin, the way I read it it is indeed in the VBE, hence my request for the surrounding lines of code.

  7. #7
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Need line continuation help with a formula

    Please Login or Register  to view this content.

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need line continuation help with a formula

    Hello again, since the formula that you are entering is in effect a text string, you can put the break anywhere, but you must close the string with " and then add the space and underscore. On the next row, use a & and an opening " to continue the string.

    for example like this
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-05-2006
    Posts
    123

    Re: Need line continuation help with a formula

    That worked. Thank you very much. Marking as 'SOLVED'.

    So these rules apply to any given text string?

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Need line continuation help with a formula

    Hey teylyn -

    You read it right, but without seeing that s/he was really in the VBE, I couldn't tell. I was think they might have been in the formula bar. You saw that (264/6949 (I'll get better))
    Last edited by MarvinP; 09-06-2010 at 11:46 PM.

  11. #11
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need line continuation help with a formula

    Yes, they apply to all text strings. You can't break a text string to the next row just with a _ as far as I know.

  12. #12
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Need line continuation help with a formula

    MarvinP,
    (264/6949
    ???????????

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need line continuation help with a formula

    If you want to use line continuation with a string you also need the concatenation operator &.

    Something like this perhaps.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1