Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default WordWrap in textbox

Hello all. I have a textbox (named txtdef) on a userform.
When the userform gets activated, txtdef gets populated
with a cell value that contains a big group of words. I'm
struggling with forcing the cell contents to wrap within
the text box so the entire definition is visible. Snip of
my code that doesnt' work:

Private Sub UserForm_Activate()

With txtdef
.Value = Cells(rndrow, 1).Offset(, 2)
.WordWrap = True
End With

End Sub

The text box ends up looking like:

***********************
*This is a test of usi*
* *
* *
***********************

instead of:

***********************
*This is a test of *
*using the text box *
*wrap properly. *
***********************

Thanks.
Jason

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default WordWrap in textbox

Jason,

Set the MultiLine property to True. E.g.,

Me.TextBox1.WordWrap = True
Me.TextBox1.MultiLine = True
Me.TextBox1.Text = "this is an example of some long text " & _
"that should wrap in the text box."



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jason Morin" wrote in
message ...
Hello all. I have a textbox (named txtdef) on a userform.
When the userform gets activated, txtdef gets populated
with a cell value that contains a big group of words. I'm
struggling with forcing the cell contents to wrap within
the text box so the entire definition is visible. Snip of
my code that doesnt' work:

Private Sub UserForm_Activate()

With txtdef
.Value = Cells(rndrow, 1).Offset(, 2)
.WordWrap = True
End With

End Sub

The text box ends up looking like:

***********************
*This is a test of usi*
* *
* *
***********************

instead of:

***********************
*This is a test of *
*using the text box *
*wrap properly. *
***********************

Thanks.
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default WordWrap in textbox

Hi Jason,

Make sure that the WordWrap and Multiline properties for the textbox are
both set to True.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jason Morin" wrote in message
...
Hello all. I have a textbox (named txtdef) on a userform.
When the userform gets activated, txtdef gets populated
with a cell value that contains a big group of words. I'm
struggling with forcing the cell contents to wrap within
the text box so the entire definition is visible. Snip of
my code that doesnt' work:

Private Sub UserForm_Activate()

With txtdef
.Value = Cells(rndrow, 1).Offset(, 2)
.WordWrap = True
End With

End Sub

The text box ends up looking like:

***********************
*This is a test of usi*
* *
* *
***********************

instead of:

***********************
*This is a test of *
*using the text box *
*wrap properly. *
***********************

Thanks.
Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
TOM TOM is offline
external usenet poster
 
Posts: 47
Default WordWrap in textbox

Hi there

I am by far no expert; however, I ran into the same problem. I needed to make sure the textbox size on the userform was first large enough to hold the data and them in the property box made multiple lines equal true

Hopes this help

Tom
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
WordWrap a TextBox on a UserForm dcornett63 Excel Discussion (Misc queries) 2 April 22nd 10 09:35 PM
using wordwrap in excel for text writing ksu1955 Excel Worksheet Functions 1 November 10th 08 12:48 AM
Why isn't Wordwrap not wrapping the last sentence? RebeccaBeth Excel Discussion (Misc queries) 1 July 5th 08 08:43 PM
MultiLine/WordWrap usage JonWayn Excel Programming 2 November 23rd 03 08:10 PM
Wordwrap wont!!!! John Baker Excel Programming 0 October 26th 03 07:12 PM


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