Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Springdale, Arkansas
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy from text box (2000 sr1)

    I am populating a text box in a user form with several lines of data. I move down a line using vbCrlf.
    If I manually select the text and copy it to another sheet everything is fine. If I try to automate it using:
    Range("A1")=userform1.textbox1.text
    I get everything in a single cell and can't use text to columns because of the delimeter.
    Any ideas on what I can use to copy the text from the userform text box to a sheet?

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy from text box (2000 sr1)

    The simplest and most straightforward way might be to put each required field in a separate text box within the user form, using the change event to update the cell. You can use the tab property to move from one required textbox to the next within the userform.

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Location
    Springdale, Arkansas
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy from text box (2000 sr1)

    Thanks... The macro to populate the text box is pulling in values from multiple cells and concatenating them in the text box.
    For instance a user can select S, M, L, LX and the text box will display the sales Last Year, This Year, % Change, and % of total for each.
    What I would like is if they want to add the text from the text box to a sheet to compare with sales for another segment, they simply select a button that would then copy to another sheet.

  4. #4
    Star Lounger
    Join Date
    Feb 2001
    Location
    Springdale, Arkansas
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy from text box (2000 sr1)

    SOLVED!!!

    I found the following in Excel's help:
    TextBox1.SelStart = 0
    TextBox1.SelLength = TextBox1.TextLength
    TextBox1.Copy

    All I have to do then is add a sheet and use activesheet.paste. It formats it perfectly!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •