View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default RowHeight and AutoFit wit Merged Cells

"Howard Kaikow" wrote in message
...
"Peter T" <peter_t@discussions wrote in message
...
It appears to be limited to one cell.

It is doing the MergeArea in which the cell lives.

<snip

The code is doing the intended deed.
It unmerges so it can set the width of col 1 to the width of the original
col 1 + col 2;
Then it does an AutoFit with the unmereged cells.
then it sets the rowheight.
then it sets the width of column 1 back to the original width, then it
merges,
and, adjusts the row height.


OK I get it now, it works as you say providing the entire MergeArea is
passed to the function (which means of course you need to know in advance
it's full meargearea) or pass say activecell.mergearea. Previously I had
only been passing a single cell and so it didn't do as expected.

I tried Screenupdating, as expected, with a non-visible wbk, may actually
have slowed down things.


I did a quick test of timings writing text to a lot of cells in an automated
instance.

xlapp.visible = false
47.51172 SU=True
40.48047 SU=False

xlapp.visible = true
65.1875 SU=True
40.32031 SU=False

time in seconds, SU refers to screenupdating)

Regards,
Peter T