View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Height + Width of a Range

this will give the overall column width of cols 1-12. Use rows(i).rowheight
for rows
Sub sumcolwidths()
For i = 1 To 12 Step 1
mcw = mcw + Columns(i).ColumnWidth
Next
MsgBox mcw
End Sub
====for the range
Sub sumcolWrowH()
With Range("a1:d5")
mr = .Rows.Count
For i = 1 To mr Step 1
mrh = mrh + Rows(i).RowHeight
Next
MsgBox "total row height =" & mrh
mc = .Columns.Count
For i = 1 To mc Step 1
mcw = mcw + Columns(i).ColumnWidth
Next
MsgBox "total col width =" & mcw
End With
End Sub
--
Don Guillett
SalesAid Software

"Stuart" wrote in message
...
What is the quickest way to return the overall width
(ie sum of columnwidths) and height (ie sum of
rowheights) for a range, please?

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004