+ Reply to Thread
Results 1 to 9 of 9

Copy List of Userform Data to Worksheet

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Copy List of Userform Data to Worksheet

    Hello,

    Is there an easier way of copying a list of various userform txtbox values to one column in excel? There are many more than what I list below, so aggregating the whole process would be more efficient for me.

    Thanks

    Please Login or Register  to view this content.
    Last edited by gsurge; 08-22-2011 at 10:15 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copy List of Userform Data to Worksheet

    That code will overwrite previous entries. Is this what you want?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Copy List of Userform Data to Worksheet

    Yes, I would like to start in the first cell of column "B" each time the code runs.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy List of Userform Data to Worksheet

    Hi gsurge

    Attached is an example of how you can do as you describe. It requires careful naming and sequencing of your TextBox Controls. You'll need to rename your TextBox Controls back to "TextBox1, TextBox2, etc".

    Try it...if you like it...use it...else lose it.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Copy List of Userform Data to Worksheet

    Thank you for the effort, but unfortunately that is a bit too restrictive for me, as re-naming is too difficult this late in the process.


    Is there no way to simply create a list of all the listbox names and export them together?

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy List of Userform Data to Worksheet

    One can get a list of all textbox controls and then you can get the names or values as needed. For your example though, I don't know how that would help as you have a combobox in the list.

    If you set the value to some specific cell, you could just set the ControlSource property.

  7. #7
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Copy List of Userform Data to Worksheet

    I actually removed the combo from the list, so it is entirely made up of listboxes.

    Can you please provide an example of what you are referring to?

  8. #8
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy List of Userform Data to Worksheet

    I first posted how to do this method at: http://www.mrexcel.com/forum/showthread.php?p=1626849

    In a Module:
    Please Login or Register  to view this content.
    In the Userform:
    Please Login or Register  to view this content.
    You can then use standard methods to iterate the control arrays to get or put what you need. In your case, you would iterate cTB().

  9. #9
    Registered User
    Join Date
    05-23-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Copy List of Userform Data to Worksheet

    That is great. Thank you all for your input

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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