+ Reply to Thread
Results 1 to 4 of 4

Splitting very long code over multiple lines in the editor....

  1. #1
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Post Splitting very long code over multiple lines in the editor....

    I'm writing a section of code to change the formulas on a worksheet based on user selection of a drop down box. The method is straight forward, using the worksheet_change event to trigger.

    However, one of the selections requires the adding together of various formula and the VBA editor is running out of space on a line to put the entire entry on one line. If I try to _ and split it over multiple lines it's giving me an error.....Expected: List separator or ). And the first : on the next line will be highlighted.

    Please Login or Register  to view this content.
    And it all works fine if it's on one line. It's been a very long day, I'm knackered, ran out of coffee 3 hours ago and I'm pretty sure this is going to turn out to be a bonehead question that's bloody obvious.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Splitting very long code over multiple lines in the editor....

    You can't split a line in the middle of a quoted string. You have to end the quote, then start a new quote on the next line. Try this:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    Re: Splitting very long code over multiple lines in the editor....

    See, told ya it was going to be a simple, bonehead question.

    Thanks!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Splitting very long code over multiple lines in the editor....

    You're welcome! Thanks for the rep, and thanks for marking your thread Solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Splitting data in one long row into multiple rows
    By karisharp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2013, 07:16 PM
  2. Splitting data in one long row into multiple rows
    By karisharp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2013, 01:18 PM
  3. Replies: 3
    Last Post: 01-12-2013, 03:12 PM
  4. Replies: 4
    Last Post: 06-28-2012, 12:42 AM
  5. Break long range into 2 code lines
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-13-2011, 01:50 PM

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