Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default How to calculate cell's contents printable width?

Hi,
Task at hand is to achieve this effect:
Short Company Name....................Meredith Rockefeller
Long Company Name Truncated If Nece.......Judy Short

Trival task in Word but how to do it programatically in Excel?
Components I think I need are calculations of printable width of cell
contents.
I then do my sums and take as much of Company Name and dots "........." to
fit a cell, given length of the Contact Name.

Other suggestions are warmly welcome :)
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to calculate cell's contents printable width?

This is on the fly, or just to set up a static report? For a proportional
font it may not be so easy....
One way to do it might be to put each string into a cell in a column by
itself and call "autofit", adjusting the length of the text until the column
is the size you need, then on to the next item etc. A bit of a kludge but
should work.

Tim

"count" wrote in message
...
Hi,
Task at hand is to achieve this effect:
Short Company Name....................Meredith Rockefeller
Long Company Name Truncated If Nece.......Judy Short

Trival task in Word but how to do it programatically in Excel?
Components I think I need are calculations of printable width of cell
contents.
I then do my sums and take as much of Company Name and dots "........." to
fit a cell, given length of the Contact Name.

Other suggestions are warmly welcome :)
Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default How to calculate cell's contents printable width?

Thanks Tim,
I thought this AutoFit might itself be calling a subroutine from some
library or other; Word-ish? :)
But which? Which? To this day I dunno what libraries have on offer.
Report will be generating "on the fly" pretty "DayRunner" inserts. The list
is a directory to the main contents, translating Company into Surname;
variable lengths are useful, so I can put maybe more identifiable details
e.g.
Big Company, Seattle..............John Doe
Florist Shop, Crown St.............Michelle

My previous version employed Excel and Word - now I'm trying to keep things
tight
Paul
Użytkownik "Tim Williams" <saxifrax@pacbell*dot*net napisał w wiadomo¶ci
...
This is on the fly, or just to set up a static report? For a proportional
font it may not be so easy....
One way to do it might be to put each string into a cell in a column by
itself and call "autofit", adjusting the length of the text until the

column
is the size you need, then on to the next item etc. A bit of a kludge but
should work.

Tim

"count" wrote in message
...
Hi,
Task at hand is to achieve this effect:
Short Company Name....................Meredith Rockefeller
Long Company Name Truncated If Nece.......Judy Short

Trival task in Word but how to do it programatically in Excel?
Components I think I need are calculations of printable width of cell
contents.
I then do my sums and take as much of Company Name and dots "........."

to
fit a cell, given length of the Contact Name.

Other suggestions are warmly welcome :)
Paul






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
Printing cell's content larger than cell width Neophyte New Users to Excel 1 October 14th 07 09:20 PM
Determine a cell's width and enter it in the cell Leonard615 Excel Discussion (Misc queries) 2 December 24th 05 06:55 PM
How to change a single cell's width TemporarilyConfused Excel Worksheet Functions 2 November 10th 04 07:36 PM
Change cell's WIDTH programmatically Marat Excel Programming 1 August 27th 03 03:31 PM
Change cell's WIDTH programmatically Marat Excel Programming 0 August 27th 03 03:23 PM


All times are GMT +1. The time now is 02:53 AM.

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"