+ Reply to Thread
Results 1 to 5 of 5

continue line of code in VBA

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    256

    continue line of code in VBA

    Hi All,

    how to continue the line of vba code into next line ?
    after Allocation6 i want put Allocation7 but continue into next line ?

    strHeader = Split("Allocation1,Allocation2,Allocation3,Allocation4,Allocation5,Allocation6, ",")

  2. #2
    Registered User
    Join Date
    10-10-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    41

    Re: continue line of code in VBA

    You need to use uderscore at the end of first line and beginning of the second line.

    Allocation6 _
    _ Allocation7")
    Vidya Palani

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: continue line of code in VBA

    Hi,

    You only need one underscore - at the end of the first line - but you also require an ampersand since you may not put a line continuation in the middle of some text:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    256

    Re: continue line of code in VBA

    strHeader = Split("Allocation1,Allocation2,Allocation3,Allocation4,Allocation5,Allocation6 _
    _Allocation7", ",")

    invalid character

  5. #5
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2013
    Posts
    256

    Re: continue line of code in VBA

    xlnitwit thank a lot ...

+ 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. Continue VBA code to next line
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-10-2014, 06:07 AM
  2. [SOLVED] Continue code on Next line
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2013, 05:34 PM
  3. Using underscore to continue code on the next line
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2012, 06:16 PM
  4. [SOLVED] Continue code on next line: Compile Error: expected list separator or )
    By ike609 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2012, 08:28 AM
  5. continue code
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-30-2008, 10:01 AM
  6. [SOLVED] Continue formula to LINE 1000 without showing FALSE
    By chieron in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-08-2005, 08:55 AM
  7. Continue line of VBA code on the next line
    By peacelittleone in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-24-2005, 03:05 PM
  8. [SOLVED] Allow code to continue regardless
    By Pat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2005, 11:06 AM

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