+ Reply to Thread
Results 1 to 4 of 4

cutting a code in 2 lines

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,849

    cutting a code in 2 lines

    Please Login or Register  to view this content.
    How do I cut the codes in the second line. For example,

    1st line
    setFirstCell = UCase(InputBox("Please enter the first cell reference to fill


    2nd line
    e.g. Reference A2 or B2", "First Cell?", "A2"))

    Thank you

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

    Re: cutting a code in 2 lines

    To continue a line of code to another line, insert " _" at the end of the line. It can go anywhere a space or delimiter can go.

    But you cannot split a line in the middle of a quoted string. You can split the two into two strings:

    Please Login or Register  to view this content.
    If you want the input box displayed to the user with a line break, you can insert a line break character without splitting the line:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,849

    Re: cutting a code in 2 lines

    ok.. Thank you.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,486

    Re: cutting a code in 2 lines

    Quote Originally Posted by 6StringJazzer View Post
    Please Login or Register  to view this content.
    If you want, you can use the built-in Line Feed character constant vbLf in place of the Chr(10) that I highlighted in red above.

+ 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. [SOLVED] VBA Code Needed On 250 lines, code changes on each line, Eaiser way to do this?
    By John37obc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2020, 10:51 AM
  2. VBA code for cutting and pasting a table of varying rows from one worksheet to another
    By Mellitus82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2019, 10:29 AM
  3. [SOLVED] Need vba code to get row lines from master through A and C col key code segment wise
    By johnlara in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2016, 12:29 AM
  4. [SOLVED] Represent (define?) a section of code with a variable (shorten long code lines)?
    By Gene@action in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2016, 03:59 PM
  5. VBA Code for cutting character lenghts into another cell
    By ziemann82 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2013, 08:54 AM
  6. [SOLVED] Macro for cutting lines from one sheet and adding to another?
    By Oz Dude in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2012, 01:26 AM
  7. Worksheet lines cutting off on the right
    By HT in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-07-2005, 01:05 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