I am trying to set the row height using Selection.Rows.AutoFit but it does
not seem to be working when there are merged cells.
Any help is appreciated.
I am trying to set the row height using Selection.Rows.AutoFit but it does
not seem to be working when there are merged cells.
Any help is appreciated.
That is correct. Merged cells won't autofit.
--
Regards,
Tom Ogilvy
"Sandy" <Sandy@discussions.microsoft.com> wrote in message
news:5F3B6BFF-AEB2-4ADB-813B-47BD3B1DEE35@microsoft.com...
> I am trying to set the row height using Selection.Rows.AutoFit but it does
> not seem to be working when there are merged cells.
>
> Any help is appreciated.
There are two basic ways to deal with the AutoFit problem with merged cells:
1) Have a single cell in the same row offscreen that is sized the same as
the merged range that has a formula that refereces the value of the active
cell of the merged range. Therefore, this cell always holds the same value as
that entered in the merged range. Use the Worksheet SelectionChange event to
force AutoFit of this cell. Since it is in the same row as the merged range,
it fixes the problem.
2) Use more complex code fired by the SelectionChange event to effect the
AutoFit.
Regards,
Greg
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks