How to automatically wrap lines in Excel (Wrap Text in Excel)
For long paragraphs of text, you need to break a line or you need a new line to align the content so that it is balanced and beautiful. However, line breaks in Excel are not as simple as pressing Enter as in MS Word software.
Today, Dexterity Software will guide you to the Warp Text tool to automatically wrap lines that match the width of the column!
Use Warp Text to automatically wrap lines for an individual cell
For example, if you have the following worksheet, columns E, F, G have longer headers than the width of the column. You do not want to adjust the width of the column.
Step 1: Select the cell you want to automatically wrap the line. On the Home tab (1) click on the Wrap Text icon (2) .
Step 2: Excel will automatically adjust the width of the row (without adjusting the width of the column) and down the line in Excel.
Step 3: For column F, despite automatic adjustment, the line breaks are not aesthetic due to the width of the column. So you can add the operation automatically adjusts the width of column F accordingly.
Automatically breaks data cells that are merged from multiple cells
The Warp Text tool can only be applied to individual cells, with cells merged with the Merge & Center tool not automatically breaking lines. So to auto-break lines for merged cells you can use by running the following Marco:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range
With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub
Open VBA window by pressing the key combination Alt + F11 , On the Sheet name contains the cell you want to automatically wrap the line you right-click select Insert -> Module .
Copy the above code into the Module window.
Return to Work Sheet, double-click the cell you want to auto-break, and then press the Enter button to automatically wrap the line.
The result is as shown below:
Good luck!
You should read it
- How to Wrap Text in Word
- Instructions automatic text carriage return in Excel - Auto line breaks when the width of the column in Excel
- 3 ways down the line in Excel, line break, down row in 1 Excel cell
- Wrap text in Word
- How to wrap text in Excel 2007, 2010, 2013, 2016
- How to indent the line in Excel
- How to Wrap Text Around a Picture in Publisher
- 4 serious mistakes everyone makes when using food wrap
May be interested
- How to wrap text in Excel 2007, 2010, 2013, 2016how to make a new line in excel 2007, 2010, 2013, 2016. in working with excel, sometimes you need to make a new line in one cell so that your data is displayed fully in one cell without overflowing to another. or not display all data. if you don't know
- Spacing lines in Excelspacing lines in excel. in the process of editing excel file, sometimes the lines are not spaced as expected or the lines are not spaced evenly. so you want to evenly line the data in excel. the following article will guide fish
- How to automatically color rows and columns in Excelto automatically color excel columns and rows when clicking, we will use vba.
- Words Jump to Lines in Excel - Tell You How to Fixtext jumping to the next line in excel makes your document 'chaotic' and not neat and professional?
- 4 basic steps to color alternating lines in Microsoft Excelwhen having to work with a long spreadsheet with numbers in excel, the probability of being mistaken between the lines is very high. therefore, to overcome this situation, we will guide you how to color alternating between lines to distinguish in excel 2013. please refer to.
- How to create Text Box in Exceltext box on excel is similar to creating on word, helping you create artistic text frames, attracting content viewers.
- Instructions for adding alternate blank lines on Microsoft Excelin the process of performing operations on excel spreadsheet, how do you add a white line to the spreadsheet?
- Instructions on how to create diagonal lines in Excel boxmanipulating 1 cell into 2 diagonal triangles with a line on excel is a very basic operation and is often performed during the process of creating tables on excel.
- MS Excel - Lesson 4: Working with lines, columns, sheetsin addition to the content of tables in excel, operations with lines, columns and sheets in this program are also important. in this article, tipsmake.com will guide you to simple operation to add or remove lines, columns or sheets in excel tables.
- Instructions on how to automatically open a Workbook when you open Excelif you are an office worker, your daily work requires regular use of excel. suppose in the case if you often use a spreadsheet. instead of spending every day opening excel and opening the excel spreadsheet, you can set up automatically opening the excel spreadsheet you want to use every time you open excel.