View Single Post
  #8   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
...
Actually the logic is not straightforward if you need to deal with
mergearea's that contain both multiple columns and rows.


The code explicitly limits itself to 1 row,


It appears to be limited to one cell.


That aside, the
code you posted could be improved though only to small effect compared

with
what will always be the reletively slow step of re-merging. However your
code as posted fails to do that, unless I understand the purpose I

assume
that's an oversite.


I do not understand the above comment.


Maybe it's me that doesn't understand the purpose of your code. I assumed
the idea was to size a row height to the "autofit" height of a mergearea
consisting of two or more cells in a row (subject not making the row height
less than it was). But your code doesn't do that at all. Instead it unmerges
the mergarea, does not resize the width of cell(1) to the original mergearea
width, then autofits row height, does not re-merge the original mergearea.
If that's the intention I don't get it.


I did try your function and in my (I guess) equally old system it took

an
eyeblink. If it took a second in yours there's something else going on.


Mine is really 10 years old, Pentium II 400 mhz.


The one I tested on is similar but a tad slower, PII 350.

Hmmm, I wonder if the AV software is interfering.
After I get off the internet, I'll disable the AV and see what happens.


I'd be alarmed to think AV might make such a difference, hope it's not that.

If you have many potential mergeareas to autofit it would be very
significantly faster to process on another sheet and not need to do
re-merge's at all.


I had thought about doing that.

Here's an example that gives you the option to do it both
ways, note the process is an entire row at a time. Watch out wrap'd code


At this time, I am not processing a row at a time, rather 2 merged cells

at
a time.
I may process a row at a time after I decide the final layout of the

cells.

Why not try the example I posted with a large number of cells in multiple
rows. Select cells in a column that intersects those rows and run as is.

In your reply to Greg you say you don't disable screenupdating as the
instance is not visible. Even not visible it's still worth disabling.

Regards,
Peter T