ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting if a value "fits" in a cell. (https://www.excelbanter.com/excel-programming/345582-detecting-if-value-fits-cell.html)

Robert Mulroney[_3_]

Detecting if a value "fits" in a cell.
 

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

Rowan Drummond[_3_]

Detecting if a value "fits" in a cell.
 
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


Robert Mulroney[_3_]

Detecting if a value "fits" in a cell.
 


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



Rowan Drummond[_3_]

Detecting if a value "fits" in a cell.
 
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



Robert Mulroney[_3_]

Detecting if a value "fits" in a cell.
 


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



Rowan Drummond[_3_]

Detecting if a value "fits" in a cell.
 
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


Robert Mulroney[_3_]

Detecting if a value "fits" in a cell.
 

ok, I'll try that thanks very much for your help.

- Rm

"Rowan Drummond" wrote:

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



Dave Peterson

Detecting if a value "fits" in a cell.
 
Merged cells don't play nice with autofitting rowheights.

Jim Rech wrote a macro called AutoFitMergedCellRowHeight that you may like:
http://groups.google.com/groups?thre...%40tkmsftngp05

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

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


--

Dave Peterson

Norman Jones

Detecting if a value "fits" in a cell.
 
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




Rowan Drummond[_3_]

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




Robert Mulroney[_3_]

Detecting if a value "fits" in a cell.
 

That's got, thanks muchly all involved. It's the little things like this
that go a long way to use acceptance of any system.

- Rm


"Rowan Drummond" wrote:

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






All times are GMT +1. The time now is 01:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com