+ Reply to Thread
Results 1 to 16 of 16

How to submit data from Userform to sheet

  1. #1
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    How to submit data from Userform to sheet

    Hi Experts

    Please assist me in this.
    I am new to macros and try to learn everything form the internet, but don't always know what to search for.

    I have created an Userform and now I am struggling to get the data from Form to Sheet.

    This is the code I am trying to use, Note that it does add the data form the form to the sheet but gives me an error after every attempt.
    Error on submit Data.JPG

    My Code
    Please Login or Register  to view this content.
    Please note that i will still add an If function due to my form having to report to 3 different sheets.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    Do you have 37 textboxes?
    Find out what value i is when the code errors

  3. #3
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    it does not say, Yes i have 37 text boxes.

    Will it be because not all textboxes contains data?

  4. #4
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    Quote Originally Posted by SteynfaardtD View Post
    it does not say, Yes i have 37 text boxes.

    Will it be because not all textboxes contains data?
    I tested it with
    Please Login or Register  to view this content.
    And this works,

    I need to have it do the copy even if the textboxes are blank. Because not all data will be submitted everytime

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    It does say....

    Hover over i when the code errors. You will see it's value is 34 you don't have a txt34 you also don't have a txt36

  6. #6
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    is there a way that i can see a list of command that i have inserted to my user form,

    Sorry for the irritation, Know it is frustrating to explain **** to people. But i really do appreciate the effort

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    In the UserForm module, you can click the dropdown.
    -

    userformVBAMo.jpg
    Last edited by davesexcel; 02-17-2019 at 07:47 AM.

  8. #8
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    noted Thanks, I saw on internet that there is way to list the commands of the userform.?

    Please assist in this,

    Please Login or Register  to view this content.
    Gives me
    Else without if
    Error

  9. #9
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    Quote Originally Posted by davesexcel View Post
    In the UserForm module, you can click the dropdown.
    -

    Attachment 611678
    Was looking for tab order, But managed that one thanks

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    You need to close all the "If " Statements
    You also need to close all the "With" statements

    If you start a "With" statement inside an "If" statement, you need to close it Before you close the "If" statement.

  11. #11
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    tried that, still gives me same error

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    What did you try

  13. #13
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    Quote Originally Posted by davesexcel View Post
    What did you try
    Please Login or Register  to view this content.

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    did you read the last line of Post#10?

  15. #15
    Forum Contributor
    Join Date
    06-25-2018
    Location
    South-Africa Pretoria
    MS-Off Ver
    2016
    Posts
    143

    Re: How to submit data from Userform to sheet

    Quote Originally Posted by davesexcel View Post
    did you read the last line of Post#10?
    Please Login or Register  to view this content.
    The MsgBox gives me error

  16. #16
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: How to submit data from Userform to sheet

    You have a space between the quotes and you have an extra "End With"

+ 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] On cell change, submit data to another sheet
    By Jamesraywebber85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-17-2018, 10:42 PM
  2. VB UserForm | Land on designated Sheet (Tab) after submit button
    By huntethic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-10-2015, 02:41 PM
  3. Submit Form w/Button & Data Management Sheet
    By lampe2007 in forum Excel General
    Replies: 1
    Last Post: 01-30-2015, 06:28 PM
  4. [SOLVED] Code error: Wont submit data from userform to seperate sheet and new line
    By mwinter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2014, 10:11 AM
  5. how to submit a data in excel vba in different workbook or sheet
    By UAZHAR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2013, 04:40 AM
  6. Transfering data from one sheet to a master sheet using Submit (command button)
    By readitdaily in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2013, 09:15 AM
  7. Transfering Data from one sheet to another using a 'submit' button
    By vjsmith10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2009, 06:29 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