Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Copying text from text box

Is there any way to copy out the text from a text box to a cell, even when
the text length is greater than 255 characters?

Currently, my copy is getting truncated to the first 255 characters.

thanks in advance
Daniel

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Copying text from text box

It's working ok for me:

TextBox1.Value = Space(20000)
Cells(1, 1).Value = TextBox1.Value
Debug.Print Len(Cells(1, 1))

check the MaxLength property of your textbox. Set it to zero.

"Daniel Bonallack" wrote:

Is there any way to copy out the text from a text box to a cell, even when
the text length is greater than 255 characters?

Currently, my copy is getting truncated to the first 255 characters.

thanks in advance
Daniel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Copying text from text box

Hi Charlie,

Thanks for the solution, but I think I didn't post very clearly. I'm
talking about an actual drawing object textbox, rather than a textbox in a
form. Any thoughts on that?

Daniel

"Charlie" wrote:

It's working ok for me:

TextBox1.Value = Space(20000)
Cells(1, 1).Value = TextBox1.Value
Debug.Print Len(Cells(1, 1))

check the MaxLength property of your textbox. Set it to zero.

"Daniel Bonallack" wrote:

Is there any way to copy out the text from a text box to a cell, even when
the text length is greater than 255 characters?

Currently, my copy is getting truncated to the first 255 characters.

thanks in advance
Daniel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Copying text from text box

Hi Daniel,

Long time no hear.

Try this


Sub LoadCellFromTextbox()
Dim tbox As Shape
Dim tmp As String
Dim tbLen As Long
Dim i As Long

Set tbox = ActiveSheet.Shapes("Text Box 1")
tbLen = tbox.TextFrame.Characters.Count
For i = 1 To tbLen Step 255

tmp = tmp & tbox.TextFrame.Characters(i, 255).Text
Next i
ActiveCell.Value = tmp
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Daniel Bonallack" wrote in
message ...
Hi Charlie,

Thanks for the solution, but I think I didn't post very clearly. I'm
talking about an actual drawing object textbox, rather than a textbox in a
form. Any thoughts on that?

Daniel

"Charlie" wrote:

It's working ok for me:

TextBox1.Value = Space(20000)
Cells(1, 1).Value = TextBox1.Value
Debug.Print Len(Cells(1, 1))

check the MaxLength property of your textbox. Set it to zero.

"Daniel Bonallack" wrote:

Is there any way to copy out the text from a text box to a cell, even
when
the text length is greater than 255 characters?

Currently, my copy is getting truncated to the first 255 characters.

thanks in advance
Daniel



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
copying text within a text box and losing formatting hokiefan1us Excel Discussion (Misc queries) 2 September 17th 08 08:41 PM
Code for searching & copying Text from 1 text file to another J@Y Excel Programming 2 June 27th 07 04:16 PM
Copying text from website OR selecting and coping certain text within a cell keri Excel Programming 2 April 12th 07 11:23 PM
Text not copying as text from Word to Excel 2003 Christine Excel Discussion (Misc queries) 4 March 3rd 05 11:33 PM
Copying text from a text box into a cell on another sheet cakonopka Excel Programming 1 January 22nd 04 07:57 PM


All times are GMT +1. The time now is 05:48 AM.

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"