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