+ Reply to Thread
Results 1 to 3 of 3

Copy multiple line Textbox data to range

  1. #1
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Copy multiple line Textbox data to range

    Hi All,

    I have a userform where I would like users to be able to paste multiple lines into a textbox with one paste (a client address from word or a PDF) then transfer the data onto a sheet with a command button. I have simplified and attached what I have so far to show what I am trying to achieve.

    I have pre-populated the textbox with exactly the kind of data the textbox is likely to have pasted into it. When the Add Address button is pressed my code adds all the data into single cell. What I need is for the data to be distributed down the column to separate each line of the address. When the address is copied from its original source and pasted into the sheet it exhibits the behaviour I am after. I have shown an example of this in the file.

    How do I get the form to behave to this requirement?

    Many thanks in advance,
    Attached Files Attached Files
    Dave C

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Copy multiple line Textbox data to range

    try this modified macro for your Add Data button:
    Please Login or Register  to view this content.
    It splits the address using the CR-LF characters at the end of each line. The only issue I can see is if you have more lines then you expect.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Contributor
    Join Date
    10-08-2013
    Location
    London
    MS-Off Ver
    365
    Posts
    136

    Re: Copy multiple line Textbox data to range

    Hi Pierre,

    Thank you for your solution, it works perfectly! Luckily in the actual application there are 7 lines that will never be exceeded.

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA - Textbox to new row line in sheet 1 within specific cell range
    By hemal89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2014, 07:40 AM
  2. Command Button to update the multiple line items in a TextBox
    By aaron.mendes in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-18-2013, 10:21 AM
  3. Macro to copy textbox data to a duplicate textbox in another worksheet
    By nitram lowm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-02-2013, 06:10 AM
  4. Replies: 3
    Last Post: 11-20-2012, 02:25 PM
  5. [SOLVED] Copy TextBox data to Worksheet in specific range
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2012, 07:13 PM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1