Results 1 to 3 of 3

Thread: Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox

  1. #1
    Join Date
    Aug 2010
    Location
    Malvern UK
    Posts
    3

    Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox

    Hi,

    VBA in Excel 2003:

    Using code I'm trying to copy text entered by the User in a UserForm
    textbox to a worksheet textbox that has just been created. My code
    seems unable to paste more than a certain number of characters, ie. if
    there are more than about a hundred characters, (I have not yet
    counted) nothing gets entered into the Worksheet textbox. However, if
    I manually copy and paste, (Ctrl C, Ctrl V) from one to the other all
    of the text copies.


    Here are my two lines that create a textbox on the worksheet then
    (should) copy the text from my UserForm Textbox.

    ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 124#,
    134#, 100, 100).Select

    Selection.Characters.Text = UserForm.TextBox1.Text

    Do you have any ideas what's wrong here?

    Many thanks.

    --
    Neil Ives

  2. #2
    Join Date
    Feb 2010
    Posts
    533

    Re: Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox

    There is a control called Microsoft Spreadsheet (right click on the toolbox , additional controls ) place this control on the userform and a label, if Excel file, do:
    Label1.Visible = False
    Spreadsheet1.Visible = True
    and paste the beach in the Spreadsheet Control

    If Word file, do :
    Label1.Visible = True
    Spreadsheet1.Visible = False
    and paste the paragraph in the label.

  3. #3
    Join Date
    Aug 2010
    Location
    Malvern UK
    Posts
    3

    Re: Excel/VBA: Copying text from UserForm Textbox to a Worksheet Textbox

    Thank you for your reply Anirvinya.

    During the day I have discovered what the problem was and I've coded a solution.
    Here's the page that gave me the information I needed.

    http://support.microsoft.com/kb/105416

    --
    Neil Ives
    --
    Neil Ives

Similar Threads

  1. Replies: 8
    Last Post: 04-12-2011, 11:24 AM
  2. Reading text file in VC++ display it in textbox
    By molocas in forum Software Development
    Replies: 1
    Last Post: 26-07-2010, 10:34 AM
  3. Textbox validation in ASP.NET
    By Kasper in forum Software Development
    Replies: 4
    Last Post: 19-01-2010, 08:28 PM
  4. Problem of textbox that does not display text
    By RyanInt in forum Software Development
    Replies: 4
    Last Post: 11-12-2009, 05:55 PM
  5. Moving from one TextBox to another with TAB
    By GeforceUser in forum Software Development
    Replies: 3
    Last Post: 05-11-2009, 06:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,965,635.90373 seconds with 17 queries