View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default AutoFit Visible Rows

You could copy the visible cells to a new temporary worksheet and autofit
there. Then use those rowheights to adjust the original row heights.

Sisilla wrote:

Hello All,

I would like to resize the rows to AutoFit the data when some columns
are hidden on my worksheet. (Some columns contain cells with a lot more
line breaks than others and cause the associated rows to be quite tall.
When these columns are hidden I would like the rows to be resized to
fit the cells without line breaks.)

SpecialCells(xlCellTypeVisible).Rows.AutoFit

resizes the rows to the tallest cell in the row whether that cell's
column has been hidden or not.

Is there any way to do what I am trying to do? I appreciate any help.

Thanks!
Sisilla


--

Dave Peterson