作者:乔山办公网日期:
返回目录:excel表格制作
用宏可以做到
批量调整Excel单元zhidao格大小,可在选中需要调整单元格大小的状态下批量调整大小。
方法步骤如下:
1、打开需要操作的EXCEL表格,选中需要批量调整单元格大小的区域,在开始工具栏中找到并点击“格式”,在其弹出的下拉专选项中点击选择“行高”。
2、在弹出的行高输入框中输入需要调整的行高数值,并点击下面的“确定”按钮。属
3、同步骤2,在格式的下拉选项中点击选择“列宽”。
4、在弹出的列宽输入框中,输入需要调整的列宽数值,并点击下面的“确定”按钮即可。
5、返回EXCEL表格,可发现已成功批量调整表格单元格的大小。
常规的一般方法恐怕不行,用VBA吧。e799bee5baa6e4b893e5b19e361
Sub 自动行高列宽()
Dim i%, rng As Range
For i = 1 To 12 Step 2
Columns(i).ColumnWidth = 0.5
Columns(i + 1).ColumnWidth = 2
Rows(i).RowHeight = 5
Rows(i + 1).RowHeight = 15
With Cells(i + 1, i + 1)
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
End With
Next
For Each rng In Range("A1:L12")
s1 = rng.Column Mod 2
s2 = rng.Row Mod 2
If s1 = 0 And s2 = 0 Then
With rng
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
End With
End If
Next
End Sub
方法一,把ABCD四列的列宽设置为合适了,然后复制,选择全表,选择性粘贴,列宽,全表所有的列都四个一组,按照ABCD的标准进行修改了。
选择性粘贴的快捷键是CTRL+ALT+V,界面如下图: