Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA- format string length to get a cell height

I have a database where some cells are taking almost half the page. Th
cells are all text. I would like to write some code that will go thr
and chop down cells over a certain height into multiple cells.

I was trying to find a relationship between the number of character
and the height, but some of these cells have multiple line breaks i
them.

Also, I would like to find a way for the code to cut in at intelligen
places if possible.

any ideas

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Excel VBA- format string length to get a cell height

You could iterate on a cell, splitting it until your RowHeight is at the
desired size.
Use Rows(x).EntireRow.AutoFit to get your cell fitting the text nicely in
each iteration.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"lcoreyl " wrote in message
...
I have a database where some cells are taking almost half the page. The
cells are all text. I would like to write some code that will go thru
and chop down cells over a certain height into multiple cells.

I was trying to find a relationship between the number of characters
and the height, but some of these cells have multiple line breaks in
them.

Also, I would like to find a way for the code to cut in at intelligent
places if possible.

any ideas?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA- format string length to get a cell height

Is there a way to trim a text string at "smart" places like a period o
line break

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default Excel VBA- format string length to get a cell height


"lcoreyl " wrote in message
...
Is there a way to trim a text string at "smart" places like a period or
line break?


Use the instr function to find the location of the period and then mid to
trim it

You could write your own function using these to do your smart trim

Keith


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA- format string length to get a cell height

Keith Willshaw wrote:

Use the instr function to find the location of the period and the
mid to
trim it
Keith [/b]


Yes!!! Thanks!! That's what I was looking for! I searched around in V
help looking for something like instr but never found it

--
Message posted from http://www.ExcelForum.com

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
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
Macro syntax to check string length in a cell El Bee Excel Discussion (Misc queries) 3 November 1st 06 09:13 PM
need to know how to control length and height of lines LPN New Users to Excel 2 August 3rd 06 12:04 AM
How do I format excel if cell value is = to 0 then row height = 0 Jane11804 Excel Discussion (Misc queries) 4 March 29th 06 12:54 PM
Excel 2002: Format Cell Height/Width buddyfl Excel Discussion (Misc queries) 1 January 31st 05 06:01 PM


All times are GMT +1. The time now is 11:39 PM.

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

About Us

"It's about Microsoft Excel"