autofit_AutoFit合并的单元格行高

本文讨论了在Excel中避免合并单元格的建议,但当必须使用合并单元格时,如何自动调整行高以适应内容变化。通过添加事件代码到工作表,可以实现合并单元格的行高自动调整,从而解决因频繁更改文本导致的手动调整行高的问题。此外,还提供了一段基于 Worksheet_Change 事件的VBA代码示例,用于在单元格内容改变时自动调整行高。
摘要由CSDN通过智能技术生成

autofit

You've most likely heard this warning -- "Avoid merged cells in your Excel worksheets!", and that is excellent advice. Merged cells can cause problems, especially when they're in a table that you'll be sorting and filtering. You'll run into more problems if you try to autofit merged cell row height.

您最有可能听到此警告-“避免在Excel工作表中合并单元格!”,这是极好的建议。 合并的单元格可能会导致问题,尤其是当它们位于要进行排序和过滤的表中时。 如果尝试自动调整合并单元格的行高,则会遇到更多问题。

被迫合并 (Forced to Merge)

Occasionally though, you might have no choice but to use one or more merged cells on a worksheet. As long as you avoid merging table cells, and proceed with caution, things might be okay.

但是,有时您可能别无选择,只能在工作表上使用一个或多个合并的单元格。 只要您避免合并表格单元格并谨慎行事,事情就可能会好的。

In the example shown below, there is an order form, and space for a note about the order. If the note will always be short, there's no need to merge the cells – just let the text flow across the columns.

在下面显示的示例中,有一个订购单,并在其中留有关于订单的备注。 如果注释始终很短,则无需合并单元格–只需让文本跨列流动即可。

mergecellsautofit01

However, if the notes will be two or more lines, you'll need to merge the cells, and turn on Wrap Text. Adjusting the column width would affect the product list that starts in row 12, so that's not an option.

但是,如果注释为两行或更多行,则需要合并单元格,然后启用“自动换行”。 调整列宽会影响从第12行开始的产品列表,因此这不是一种选择。

合并单元格行高 (Merged Cell Row Height

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值