View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Detecting if a value "fits" in a cell.

Thanks for that Norman. Hopefully the OP will return here and find it if
he doesn't succeed with removing the merged cell.

Kind Regards
Rowan

Norman Jones wrote:
Hi Rowan,

I share your dislike of merged cells and never use them.

However, Jim Rech has posted code to address the merged cells / autofit
problem. See the final post in the following thread:

http://tinyurl.com/aknxy


---
Regards,
Norman



"Rowan Drummond" wrote in message
...

The autofit command does not appear to work with merged cells (no
surprises there).

If you only need your merging across columns then maybe you could remove
the merge and replace it with Center Across Selection. I am assuming you
already have Wrap Text applied which is why you are wanting to set the
autofit to the row. With Center Across Selection and Wrap Text applied the
row may automatically resize to fit the text but if not you can then use:

range("B5").entirerow.autofit

Hope this helps
Rowan

Robert Mulroney wrote:

um... both (he say's sheepishly). It really only needs to be merged
across the columns I suppose. We're looking at fitting the row height
using auto fit that might make it a bit easier.

- Rm



"Rowan Drummond" wrote:



Merged cells are generally a nightmare to work with but I'll give it a
go. Is it merged vertically (eg A1:A2) or horizontally (eg A1:B1).

Regards
Rowan

Robert Mulroney wrote:


Ah, good, thanks. It suits me better to use entirerow instead of
entirecolumn. BUT, can you make it work for a merged cell?

- Rm

"Rowan Drummond" wrote:




no replys about srink to fit and word warp, please.

What about:

range("D4").EntireColumn.AutoFit

Regards
Rowan

Robert Mulroney wrote:



Is it possible to detect if a value is being fully displayed in a
cell? I want to resize a cell so that text won't flow over adjectent
cells and numbers don't display as the ##### thing. To do that I need
a check to see if the value fits in the first place.

I have a report where users are being asked to comment on financial
preformance. As always my users don't want to play ball, and we can't
agree on how big the comment cell should be. I'd like to be able to
grow or srink it depending on the comment provided.
no replys about srink to fit and word warp, please.

- Rm