+ Reply to Thread
Results 1 to 7 of 7

Text boxes, user forms and command button help needed

  1. #1
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Text boxes, user forms and command button help needed

    hi guys,

    this is my first post and i really hope one of you lovely people can help me.
    Ok here's my dilemma.

    I have created a userform with multiple text boxes in it. The idea is that an individual will populate these text boxes with the appropriate information. they would then click a command button that would copy all text boxes in order and with spacing onto one text box on a second userfom to allow all the information to be copied and pasted into a different programme. i have built both userforms and the command button. the problem i am having is writing the VBA to copy more than one textbox and with spacing. at the moment when i submit the iformation by pressing the command button it only copies one text box data or all data without spacing.

    so does anyone know the correct VBA to copy multiple text boxes onto one text box keeping the spacing ?

    Thank you so much in advance for your help
    Last edited by brewsi; 05-11-2014 at 02:38 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,785

    Re: Text boxes, user forms and command button help needed

    What do you mean by "spacing"--"with spacing", "without spacing", "keeping the spacing"?

    I would think it would be something as simple as

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Text boxes, user forms and command button help needed

    hi jazzer,

    thanks for responding so fast.

    by spacing i mean the spacing between the text boxes. E.g


    userform 1 Text box1 .....Data in entered here....

    Text box2 .....Data in entered here...

    Text box3 .....Data in entered here....

    command button clicked

    Userform 2 Textbook 1 ....Data in entered here...

    ....Data in entered here...

    ....Data in entered here...

    so you see the position of the text boxes on userform one is retained in userform 2 text box 1

    hope this makes things clearer

    Again thanks in advance

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,785

    Re: Text boxes, user forms and command button help needed

    If the sample line of code I posted doesn't help you then attach your file.

    Do you have code in place to try to do what you want, even if it doesn't work?

  5. #5
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Text boxes, user forms and command button help needed

    thanks jazzer

    much appreciated. its actually a work project so ill try it tomorrow. How would i use the code for multiple text boxes

    textbox1 = textbox2 & vbCrLF & textbox3

    would i need to put

    textbox1 = textbox2 & vbCrLF & textbox3 & vbCrLF & textbox & vbCrLF & textbox5

    or would it just be

    textbox1 = textbox2 & vbCrLF & textbox3& textbox4& textbox5& textbox6 and so on ?

    Sorry if that sounds like a silly question i only starting teaching myself excel at the end of April so still quite new to the code.

    Thanks again

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,785

    Re: Text boxes, user forms and command button help needed

    vbCrLf is a special character that means Carriage Return and Line Feed. It forces a line break in the middle of your text, so yes, you need to repeat it in between every pair of textboxes.

  7. #7
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Text boxes, user forms and command button help needed

    perfect

    thanks so much. ill let you know how it goes

+ 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] Help to create Command Button with text boxes input
    By pasj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2013, 12:07 PM
  2. User Forms Basics - Text Boxes to Named Range
    By T.J. Lanza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 03:35 PM
  3. Help needed! How use a Command Button to pop up a text box in Excel?
    By matt@career-horizons.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2006, 02:05 PM
  4. Entering data into two text boxes using one command button
    By Charlie Chalk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2006, 11:00 AM
  5. [SOLVED] User Forms - Command Button defines value to be used later
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2006, 06:00 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1