Shrink text to fit in a cell
How to shrink cell content to fit in the same cell using Excel and VBA methods
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. |
3. Select the Alignment tab. 4. Check the Shrink to fit checkbox. 5. 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
Worksheets("Sheet1").Range("B2").ShrinkToFit = True
End Sub
PREREQUISITES
Worksheet Names: Have a worksheet named Sheet1.
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.
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
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.
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 |
---|---|---|
Wrap text | How to fit content in a cell without adjusting column width using Excel and VBA methods | |
Unwrap text | How to unwrap content in a cell using Excel and VBA methods | |
Merge cells | How to merge cells using Excel and VBA methods | |
Unmerge cells | How to unmerge cells using Excel and VBA methods |