①VBA自行设置行高
Sub SetMyRowHeight()
MsgBox "将当前单元格所在的行高设置为29"
Dim rRow As Long, iRow As Long
rRow = ActiveCell.Row
iRow = ActiveSheet.Rows(rRow).RowHeight
ActiveSheet.Rows(rRow).RowHeight = 29
MsgBox "恢复到原来的行高"
ActiveSheet.Rows(rRow).RowHeight = iRow
End Sub
②VBA自行设置列宽
Sub SetMyColumnWidth()
MsgBox "将当前单元格所在列的列宽设置为36"
Dim cColumn As Long, iColumn As Long
cColumn = ActiveCell.Column
iColumn = ActiveSheet.Columns(cColumn).ColumnWidth
ActiveSheet.Columns(cColumn).ColumnWidth =36
MsgBox "恢复至原来的列宽"
ActiveSheet.Columns(cColumn).ColumnWidth = iColumn
End Sub
③VBA恢复行高列宽为默认值
Sub ReSetMyRowHeightAndColumnWidth()
MsgBox "将当前单元格所在的行高和列宽恢复为标准值"
Selection.UseStandardHeight = True
Selection.UseStandardWidth = True
End Sub