+ Reply to Thread
Results 1 to 13 of 13

How to transfer data from UserForm to Worksheet

  1. #1
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    How to transfer data from UserForm to Worksheet

    I made my firt Userform. But i can't get the hang of writing the VBA with it.

    I made a Userform1 with:
    ComboBox 1 to 25
    TextBox 1 to 3
    2 buttons (Ok, Annuleren)


    When pusht Ok i like to write a code that copy's all the ComboBoxes en the Textboxes in the same row (b,c,d,e,f,...) under the first empty cel in collum B. Also all boxes has to be fild accapt textbox 1.


    When pust Annuleren is whant to delete everyting and hide the Userform.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: How to transfer data from UserForm to Worksheet

    Hello Frigide,

    I changed the title of your post to reflect your question.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to transfer data from UserForm to Worksheet

    I made my firt Userform
    Frigide, CONGRATULATIONS.

    About your query, this is a far to general description to work with.

    Post your workbook with userform in it so we can check Sheetnames, Control names, what goes where, which formats to apply to give you to the point advice on how to proceed.

    also there are tig threads here regarding userforms and how to write to worksheet. I'm confident you can get some useful information there too.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: How to transfer data from UserForm to Worksheet

    This is the userform.
    When pusht Ok i like to write a code that copy's all the ComboBoxes en the Textboxes in the same row (b,c,d,e,f,...) under the first empty cel in collum B. Also all boxes has to be fild accept textbox 1.
    Attached Files Attached Files

  5. #5
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: How to transfer data from UserForm to Worksheet

    Give the attached a try, only combos 4 - 7 are loaded, chose from them and press OK, this should save to Sheet1.
    It is only a brief demo using Tables for data storage, the combos list is array loaded a method more stable than rowsource.
    Start your code with 'Option Explicit' this will force you to declare your variables, this proves beneficial, always run debug.
    There is a small routine in a module 'ClearForm' this would be used many times as you develop your application.
    happy coding.
    torachan.

    table text font color needs setting to black - not visible as white by mistake.
    Attached Files Attached Files
    Last edited by torachan; 11-18-2019 at 01:08 PM. Reason: cannot see text

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to transfer data from UserForm to Worksheet

    Let's start with this.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: How to transfer data from UserForm to Worksheet

    Thanks! I was programming line for line. I find it difficult to do the For i = think. Ones again, thanks!!

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to transfer data from UserForm to Worksheet

    you're welcome and thanks for rep+.

  9. #9
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: How to transfer data from UserForm to Worksheet

    In the sample it is working fine. I changes the code a bit and made a sheet whit a nice looking collers and rows. Now the code is not working anymore.
    This is de code where it is going wrong. I dod nothing to fancy. Only toke the first 3 line for some headers!
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by Frigide; 11-18-2019 at 04:36 PM.

  10. #10
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: How to transfer data from UserForm to Worksheet

    If you find the time maybe you van look for me?
    Attached Files Attached Files

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to transfer data from UserForm to Worksheet

    According to your new example file in Post#10.

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Re: How to transfer data from UserForm to Worksheet

    Works like a charm thanks again!

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to transfer data from UserForm to Worksheet

    Glad to help and thanks for rep+.

+ 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] Transfer Data from Userform to Worksheet Table
    By How How in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-10-2017, 04:02 PM
  2. Data Transfer: Userform to Worksheet
    By smartbuyer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2014, 01:15 PM
  3. [SOLVED] Transfer Userform data on 1 worksheet to different worksheet (empty row = wrong sheet)
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 10:08 AM
  4. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  5. [SOLVED] Userform transfer data into worksheet
    By kheytli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2013, 01:09 PM
  6. Replies: 20
    Last Post: 05-24-2012, 10:51 AM
  7. Transfer Data From Userform to Worksheet
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2012, 07:12 AM

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