Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Lines in cell?

Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"







  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Lines in cell?

The helpfile item "Worksheet and workbook specifications" should give you a
guide to the limits of Excel

"Helmut Weber" wrote:

Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Lines in cell?

I think Helmut was looking to find a way to determine how many times the cell
wrapped to new lines (with no alt-enters in the cell).



bigwheel wrote:

The helpfile item "Worksheet and workbook specifications" should give you a
guide to the limits of Excel

"Helmut Weber" wrote:

Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"









--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Lines in cell?

Helmut,
Using a fixed-width font should get you close.

NickHK

"Helmut Weber" wrote in message
...
Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"









  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Lines in cell?

If your text is in row 6 for example, Paste this into a code window and then
run it:

Private Sub rowfit()
Rows("6:6").EntireRow.AutoFit
End Sub

If you are trying to do it without a macro I'm not sure if you can do it
without double clicking between the row numbers to autofit it (which does
work for me). If you don't mind a macro, then you could do a target macro
that would autofit every cell change in a chosen range.

"Helmut Weber" wrote in message
...
Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Lines in cell?

Hi Helmut,

I suspect it can be done, but if it can would involve a lot of work. Is it
worth it ?

If it is REALLY worth it, for an idea of what I have in mind, I posted
something partially related in DicksBolg
http://www.dicks-blog.com/archives/2005/05/16/1131/

I had problems posting there, "<=" just halts and "0)" produces a smiley.
I did it in chunks, look for posts 4, 5 & 6. It'll take some reassembling.
Anyway, what I have in mind is fitting to a texbox same width as the column.
But I'll leave that to you!

Regards,
Peter T

If you can't piece that code together contact me and I'll forward the
original.
pmbthornton gmail com


"Helmut Weber" wrote in message
...
Hi everybody,

if anybody of those, who told me before
"no way", is reading this, forgive me for trying again.

I'd like to know, how many lines there are in a cell.
The cell's format alignment is set to "wrap text".
There are no forced linefeeds.
The text is about 200 to 1000 characters long.
Lines may hold about 60 characters.
There are no merged or split cells.

The reason for all this is to overcome somehow
Excel's seemably buggy "format row autofit",
as after executing "autofit" still not all lines in a cell
are displayed. If I increase the row's hight sufficiently,
I see all of the text. I thought about counting
the lines in a cell, get font size and set
the row's height to a value resulting from the font size
and the number of lines.

BTW:
There is no way for me to prevent users in all of the world
from misusing Excel as a word-processor.
<sigh

Any ideas?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Lines in cell?

Hi Peter,

Hi Helmut,

I suspect it can be done, but if it can would involve a lot of work. Is it
worth it ?


Sorry to say so, No.

There are more than 500 rows in the sheet,
with more than 20 columns.

But you've opened my eyes to what is doable,
if it had to be.

Thank You.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Excel 2007 chart with multiple lines, mouse doesn't track lines sfuelling Charts and Charting in Excel 1 August 19th 09 09:41 PM
inserted lines move how to place lines in proper cell? Deschi Excel Worksheet Functions 0 February 8th 09 01:15 PM
Cell Box - one of the 4 cell lines is open - the side. How I fix ? MUTTMIND New Users to Excel 3 January 16th 09 09:59 AM
Cell lines errolt Excel Discussion (Misc queries) 2 November 27th 07 08:25 PM
Hard Returns in a Cell (or two lines in a cell) Susan N via OfficeKB.com Excel Discussion (Misc queries) 1 August 17th 05 04:07 PM


All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"