Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Size a text box based on length

I need to automatically adjust the height of the row attached to text box,
based on the length or amount of data in the text box. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Size a text box based on length

Not sure what you mean, but does this work ?

Range("A1").Rows.AutoFit

NickHK

"Troubled User" wrote in message
...
I need to automatically adjust the height of the row attached to text box,
based on the length or amount of data in the text box. Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Size a text box based on length

AutoFit will size to the max cell size, but does not include a text box that
is bound to a cell within the range. Thanks.

"NickHK" wrote:

Not sure what you mean, but does this work ?

Range("A1").Rows.AutoFit

NickHK

"Troubled User" wrote in message
...
I need to automatically adjust the height of the row attached to text box,
based on the length or amount of data in the text box. Any ideas?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Size a text box based on length

What do you mean by "adjust the height of the row attached to text box" then
?
If you mean adjust to the height of THAT cell, then maybe:

Private Sub CommandButton1_Click()
Dim DestCell As Range
Dim TestCell As Range

'Cell linked to Textbox
Set DestCell = Range("A1")

'Where it will not interfere with current column widths/row heights
Set TestCell = Range("U30")

With TestCell
.ColumnWidth = DestCell.ColumnWidth
.Value = DestCell.Value
.Rows.AutoFit
DestCell.RowHeight = .RowHeight
End With

End Sub

NickHL

"Troubled User" wrote in message
...
AutoFit will size to the max cell size, but does not include a text box

that
is bound to a cell within the range. Thanks.

"NickHK" wrote:

Not sure what you mean, but does this work ?

Range("A1").Rows.AutoFit

NickHK

"Troubled User" wrote in

message
...
I need to automatically adjust the height of the row attached to text

box,
based on the length or amount of data in the text box. Any ideas?






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
Summing a column based on the length of text in a cell in anothercolumn [email protected] Excel Worksheet Functions 13 November 26th 08 05:42 PM
Sizing Autoshapes based on text length Nick Hebb Excel Programming 5 November 6th 05 03:32 PM
How do I "conditionally" change font size based on text length? Found in Florida Excel Programming 2 October 10th 05 11:12 PM
Macro or Function to make text size to suite text Length? lbbss Excel Discussion (Misc queries) 4 December 14th 04 07:53 PM
The text length versus the cell size... shockley Excel Programming 2 September 14th 03 02:43 AM


All times are GMT +1. The time now is 08:10 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"