Shrink text to fit in a cell

How to shrink cell content to fit in the same cell using Excel and VBA methods

METHOD 1. Shrink text to fit in a cell

EXCEL

Right-click on the cell in which to shrink text > Format Cells > Alignment tab > Check Shrink to fit checkbox > Click OK

1. Right-click on the cell in which you want to wrap text.
2. Select Format Cells.
Right-click on cell in which to wrap text and click Format Cells

3. Select the Alignment tab.
4. Check the Shrink to fit checkbox.
5. Click OK.
Select Alignment tab, check Shrink to fit and click OK

METHOD 1. Shrink text to fit in a cell using VBA

VBA

Sub Shrink_to_fit()
'shrink text to fit in cell B2 in worksheet named Sheet1
Worksheets("Sheet1").Range("B2").ShrinkToFit = True

End Sub

PREREQUISITES
Worksheet Names: Have a worksheet named Sheet1.
ADJUSTABLE PARAMETERS
Sheet Selection: Select the worksheet in which you want to shrink text by changing the Sheet1 worksheet name in the VBA code.
Shrink Text Cell Selection: Select the cell in which you want to shrink the text to fit in a cell by changing the cell reference ("B2") in the VBA code.

METHOD 2. Shrink text to fit in selected cells using VBA

VBA

Sub Shrink_to_fit()
'shrink text to fit in selected cell
Selection.ShrinkToFit = True

End Sub

Explanation about how to shrink text to fit

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to shrink cell content to fit in the same cell using Excel and VBA methods.

Excel Method: This tutorial provides one Excel method that can be applied to wrap text. This method uses the Format cells option and can be accomplished in five steps.

VBA Methods: This tutorial provides two VBA methods that can be applied to shrink the text to fit in a cell. The first method shrinks text in the cells specified in the VBA code. The second method shrinks text the selected cells.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to fit content in a cell without adjusting column width using Excel and VBA methods
How to unwrap content in a cell using Excel and VBA methods
How to merge cells using Excel and VBA methods
How to unmerge cells using Excel and VBA methods