2009-08-25 08:54:21 +0000 2009-08-25 08:54:21 +0000
23
23
Advertisement

如何让Excel中的单元格自动调整高度以适应被包裹的文本内容?

Advertisement

我在Excel中拥有一个被包裹的文本内容的单元格,我想将单元格格式化,使其高度调整到适合可以跨越几行的内容。我如何才能实现这个行为?

Advertisement
Advertisement

答案 (8)

27
27
27
2012-08-07 04:27:05 +0000

来自 http://support.microsoft.com/kb/149663

要调整行的高度以适应单元格中的所有文本,请按照以下步骤进行操作:

选择该行。

在 Microsoft Office Excel 2003 和早期版本的 Excel 中,在 “格式 "菜单中指向 "行",然后单击 "自动适配"。

在Microsoft Office Excel 2007中,单击 "主页 "选项卡,单击 "单元格 "组中的 "格式",然后单击 "自动匹配行高度"。

11
11
11
2009-08-25 09:02:18 +0000

尝试

选择列 -> 右键单击列 -> 格式化单元格 ->对齐标签 -> 包裹文本

4
Advertisement
4
4
2013-06-14 18:06:20 +0000
Advertisement

请注意,autofit对合并后的单元格不起作用。

请看微软的回答: 您不能对Excel中包含合并单元格的行或列使用AutoFit功能

2
2
2
2009-08-26 15:28:37 +0000

如果它没有自动完成,那么将光标放在行号之间的小行上(例如:1和2之间),然后双击,这将调整该行的大小(小行的正上方,在示例中:1),使所有的东西都能看到(从垂直方向)。

0
Advertisement
0
0
2009-09-22 14:54:57 +0000
Advertisement

你知道宏吗?把下面的代码放在

Application.ActiveCell.WrapText = True

在你的 Worksheet_SelectionChange 子例程中。

0
0
0
2013-04-19 21:38:43 +0000

我唯一能让它像预期的那样工作的方法是用CTRL-A突出显示整个工作表,取消点击工具栏中的 “Wrap Text "按钮,然后重新选择它。其他设置没有变化,但每一行都是 "适当 "的高度,适合它的内容。

0
Advertisement
0
0
2009-10-28 18:13:08 +0000
Advertisement

一个VBA的解决方案是:

Call Application.ActiveCell.AutoFit
0
0
0
2014-11-25 13:39:44 +0000

我创建了下面的VB代码来调整标题行的大小,当一个单元格在一个范围内(B2:B1500)时,因为日期值超过12/28/2014会导致标题显示一个警告,在时间表中,这些日期将进入2015年的第1周:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCells As Range

    ' The variable KeyCells contains the cells that will
    ' cause an Action when they are changed.
    Set KeyCells = Range("B2:B1500")

    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
           Is Nothing Then

        ' Change the height of the header row when one of the defined cdlls is changed
        Rows("1:1").EntireRow.AutoFit

    End If
End Sub
Advertisement

相关问题

6
13
9
10
5
Advertisement
Advertisement