LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default use VBA to tell if all the text in a TextBox or TextFrame can be displayed

Brian,
Not great, but maybe this can get you started:

'Assumes 2 textboxes on a WS
Private Sub CommandButton3_Click()

'Add a lot of text to TextBox1
TextBox1.Text = "Add a lot of text to TextBox1" & vbNewLine & "Add a lot of
text to TextBox1" & vbNewLine & "Add a lot of text to TextBox1" & vbNewLine
& "Add a lot of text to TextBox1"

With TextBox2
.AutoSize = False
.Text = TextBox1.Text
.AutoSize = True
If .Height TextBox1.Height Then
MsgBox "Text does not fit"
End If
End With

End Sub

NickHK

wrote in message
ups.com...
Is there a way to use VBA to determine if a TextBox or TextFrame
object is sized large enough to display all the text it contains?

Thanks,

Brian Murphy



 
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
TextFrame.Characters.Text returns truncated string Dennis Excel Programming 2 October 1st 06 11:23 PM
Interesting problem with VBA generated textbox (or textframe of shape) length Bill Dilworth Excel Programming 3 December 22nd 05 04:09 PM
Text not fully displayed when text direction changed Mikey9131 Excel Discussion (Misc queries) 3 November 30th 05 12:09 PM
Highlight all Text in a Textbox when the textbox is selected RPIJG[_73_] Excel Programming 3 October 28th 05 08:28 PM
.TextFrame.Characters.Text property readOnly in function?? VB_Help Excel Programming 1 August 27th 03 05:16 PM


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