如何计算总列宽
复制这段代码,在excel中按Alt+F11打开VBA编辑器,双击This Workbook,在右边的窗口中粘贴代码,关闭。 选中列后,点开发工具—宏,执行。 记得要选中,你想相加的行
Sub width()
Dim N#, Col As Range
N = 0
For Each Col In Selection.Columns
N = N + Col.ColumnWidth
Next Col
MsgBox N
End Sub
如何计算总行高
Sub height()
Dim N#, Col As Range
N = 0
For Each Col In Selection.Rows("1:11") #第1行到第11行
N = N + Col.RowHeight
Next Col
MsgBox N
End Sub
1磅≈0.353mm