+ Reply to Thread
Results 1 to 5 of 5

Thread: Expected End of Line; Trying to break up string block in VBEditor

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    369

    Expected End of Line; Trying to break up string block in VBEditor

    I know this is going to be an easy one, but I can't get it.

    I would like this
    Dim strCleanup As String
      strCleanup = "There was an error retrieving your geocoordinates. Please ensure an accurate, non-range address e.g. 701 - 711 Lake Street; and retry."
    to appear as
    Dim strCleanup As String
      strCleanup = "There was an error retrieving your geocoordinates. Please ensure an accurate
    , non-range address e.g. 701 - 711 Lake Street; and retry."
    in my vbeditor.

    I have tried the <space>_ continuation character, but everytime I do I receive an Expected: End Of Statement (Compile Error).

    Baffled.

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Expected End of Line; Trying to break up string block in VBEditor

     strCleanup =  "There was an error retrieving your geocoordinates. Please ensure an accurate, " & VBnewline & "non-range address e.g. 701 - 711 Lake Street; and retry."
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    369

    Re: Expected End of Line; Trying to break up string block in VBEditor

    JJ,

    strCleanup is a string used in a MsgBox. I am not looking to break up the string for presentation, just within my editor so it doesn't run off the screen.

  4. #4
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Expected End of Line; Trying to break up string block in VBEditor

    In that case you might need to use the end sign. That's the only solution I can think of

    Dim strcleanup As String
    strcleanup = "There was an error retrieving your geocoordinates. Please ensure an accurate " & _
    "non-range address e.g. 701 - 711 Lake Street; and retry"
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  5. #5
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    369

    Re: Expected End of Line; Trying to break up string block in VBEditor

    Feels clunky, but it did the trick. Thanks JJ.

+ 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.2.0