+ Reply to Thread
Results 1 to 8 of 8

Special Character for newline in a cell value

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Special Character for newline in a cell value

    Hello,

    I am integrating the excel in my application.

    I have several columns in th eexcel and one of the cell will have values with new line. In excel i can do it by using (Alt+Enter). But when i am programming, in the shared string i tried to use special charaters but could not find one to create new line in the cell.

    Could you please help?

    For Example:

    Name Value Text
    Piyush SE I am from Bangalore (Alt+Enter)
    I am a programmer

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Special Character for newline in a cell value

    I believe char(10) is the carriage return.

  3. #3
    Registered User
    Join Date
    02-21-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Special Character for newline in a cell value

    Hi Dave,

    Thank you for your reply.
    I do not understand char(10). Is there a special character? Ex '#' or similar?

    Thanks

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Special Character for newline in a cell value

    vbNewLine is easy to remember

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    02-21-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Special Character for newline in a cell value

    Hi Roy,

    Unfortunately i am not using VB but ABAP. I tried to concatenate the line feed ( Char 13 ) in the string but did not work.

    lv_string = lv_string & 'CHAR10' & 'Newline'.

    But it does not create a new line in the cell.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Special Character for newline in a cell value

    Unfortunately this is an Excel VBA Forum

  7. #7
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Special Character for newline in a cell value

    According to here it is 0D.

    Plus, make sure the cell is formatted to wrap text.
    Hope that helps,

    Colin

    RAD Excel Blog

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Special Character for newline in a cell value

    Quote Originally Posted by piyushdeora View Post
    Hi Dave,

    Thank you for your reply.
    I do not understand char(10). Is there a special character? Ex '#' or similar?

    Thanks
    Yes, it is called Char(10)
    =a1&char(10)&b1
    Wrap text format as specified in the previous post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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