Excel VBA macrosHack 37
    carriage return
    excel vba
    excel vba text
    line feed
    paragraphs
    textboxes

    Add Line Breaks in Excel VBA: vbCrLf, Chr(10) and Chr(13) Explained

    Excel Hack #37

    11 views
    1 min read
    2019-02-23
    Add Line Breaks in Excel VBA: vbCrLf, Chr(10) and Chr(13) Explained

    So, you might be working on a code that returns lines or paragraphs of text into a cell or text box in Microsoft Excel, and you want to make sure that this text is presently in an orderly, parapraph-l...

    So, you might be working on a code that returns lines or paragraphs of text into a cell or text box in Microsoft Excel, and you want to make sure that this text is presently in an orderly, parapraph-like fashion. This is where the carriage return + line feed code comes in handy. This code will space out the text by creating line breaks wherever it is inserted, so that a new paragraph is automatically formed. It has a similar effect to using Alt+Enter in regular Microsoft Excel when entering data into sheet cells. This code is vbCrLf (or Chr10). This is basically how it works: Code 1:
    Cells(1,3).value = "Hi " & "My name is Excel User"
    Result: PicturenoCarr Code 2:
    Cells(1,3).value = "Hi " & Chr(10) & "My name is Excel User"
    OR
    Cells(1,3).value = "Hi " & vbCrLf  & "My name is Excel User"
    Result: PictureCarr  

    Frequently Asked Questions