+ Reply to Thread
Results 1 to 4 of 4

Not sure how to write the code for the command button when making a userform

  1. #1
    Registered User
    Join Date
    04-11-2015
    Location
    england
    MS-Off Ver
    2007
    Posts
    2

    Question Not sure how to write the code for the command button when making a userform

    Could someone kindly just look at the code and tell me what to change, Thank you
    this is my first time doing this and I got really confused when looking at other people examples. Underneath is a screenshot of what I'm trying to create but every time I try to add the information this error pops up:

    error in excel.png





    screenshot of entry form.png


    Please Login or Register  to view this content.
    Last edited by FDibbins; 04-12-2015 at 05:45 PM.

  2. #2
    Forum Contributor
    Join Date
    07-30-2014
    Location
    USA
    MS-Off Ver
    Version 14.4.3, Mac 2011
    Posts
    145

    Re: Not sure how to write the code for the command button when making a userform

    I haven't made any user forms yet (still very new to VBA) but I came across this webpage with some code that might be of interest to you.
    http://www.techrepublic.com/article/...ntry-in-excel/

    Good luck!
    (hopefully someone with real knowledge leaves a more useful comment)

  3. #3
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Not sure how to write the code for the command button when making a userform

    Your code seems to error out specifically at:
    Please Login or Register  to view this content.
    The error code simply means that you haven't labeled a textbox as "textbox_address" in your userform.
    Check the textbox that your address goes into and see if the name is indeed "textbox_address" (probably not).

    If it does all seem to be correct, please share your workbook.
    Thanks.
    Please click the * below if this helps

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Not sure how to write the code for the command button when making a userform

    andzia welcome to the forum

    The forum somwetimes has problems displaying images uploaded here, depending on what browser other members are using, so please upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    Also, Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    I will add them for you - this time
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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] Userform: Code for DELETE on a command button
    By Gal403 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2014, 01:28 AM
  2. [SOLVED] VBA Code to Gray Out Command Button on Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2013, 02:49 PM
  3. [SOLVED] Making userform rows visible with a command button
    By GalmOne in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-14-2012, 11:48 AM
  4. Command button code to write to worksheet and then open userform
    By Reidm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2008, 10:33 AM
  5. Replies: 1
    Last Post: 07-17-2006, 09:09 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