我有一个动态数据没有设置在数据高度。如何在数据高度中设置动态高度。
sub test()
Sheets(1).Cells(2, 16).Value = "Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal. Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal. Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal. Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal."
End sub单元数据全数据显示现在我如何使用"WrapText“和"AutoFit”,但全数据显示单元,但更多的话,在隐藏在单元格中。行高409如何增加单元格高度。
给我样本链接和输出。
发布于 2018-10-27 11:30:44
不要使用合并单元格和自动匹配,只使用换行文本,并将列宽设置为任何在数据上看起来不错的列宽。
Sub test()
Dim row_num
Dim col_num
row_num = 2
col_num = 16
Columns(col_num).ColumnWidth = 65
Sheets(1).Cells(row_num, col_num).Value = "Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal. Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal.Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same.To convert graphic display.After transfer to HMI and test operation finished." _
& "Test system with process is working normal. Process inform HMI finish oil fiber display not show we check found HMI damage after we check no have spare after we move HMI alarm display at control spinning to install. But the type of HMI not same. To convert graphic display.After transfer to HMI and test operation finished. Test system with process is working normal."
Sheets(1).Cells(row_num, col_num).WrapText = True
End Sub编辑版
您可以检查以下代码的自动装配合并单元格。
列A到C的单元格宽度设置为12,对于高度,占文本长度45%的比率取决于这个宽度,如果要更改宽度,也必须更改比率。
Sub test1()
Sheets(1).Cells(2, 1).Value = " Testing Testing TestingTestingTesting Testing Testing TestingTestingTesting Testing TestingTesting Testing Testing TestingTesting Testing Testing Testing TestingTesting Testing TestingTesting Testing Testing Testing Testing Testing Testing Testing TestingTestingTesting Testing"
Range("A2:C2").Merge
Range("A2:C2").WrapText = True
Columns("A:C").ColumnWidth = 12
text_length = Len(Sheets(1).Cells(2, 1).Value)
Rows("2:2").RowHeight = text_length * 0.45
End Subhttps://stackoverflow.com/questions/53020567
复制相似问题