EXCEL表格中怎么做到:在B列单元格中输入数字(如1-9)文件根据录入的数字自动调整行高

excel

1个回答

写回答

jjckyyy

2026-02-14 03:12

+ 关注

VBA
VBA

代码改好了~ 这个自动调整行高的功能得用VBA来实现。你可以按 alt+F11 进入VBA编辑器,然后把下面这段代码粘贴到对应的工作表里:VBAPrivate Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 2 And Target.Row 8 Then If Target.Value 0 And Target.Value 10 Then Target.RowHeight = Target.Value * .Height + (Target.Value - 1) * .Height End If End IfEnd Sub

保存一下,回去试试看就行啦!有问题再问~

举报有用(18分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号