+ Reply to Thread
Results 1 to 5 of 5

VB Code to Capture Data from User Form

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to Capture Data from User Form

    Hello:

    Please refer to the attached sheet.

    I am learning how to create a User Form in Excel.
    I have created a form and need to capture data when data is entered but when i run, it gives error.
    Also need a command Button in Sheet1 to activate the user form.

    Please help me figure out why it is giving error.

    Thanks

    Riz
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VB Code to Capture Data from User Form

    Add a new module Insert>Module.

    Paste this code in it.
    Please Login or Register  to view this content.
    Right click the button, select Assign Macro..., pick OpenForm from the list an press Enter.

    The form will now open when you click the button.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Capture Data from User Form

    Hi Norie:

    That solves one problem.
    Can you now please click the button to see the error in my code and rectify the error problem.

    Thanks

    Riz

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VB Code to Capture Data from User Form

    x1Up should be xlUp.

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to Capture Data from User Form

    Hi Norie:

    I got it ...Thanks a lot.

    I also need to use the Close Button to close the form and also after entering the data, need to clear the field in the form for the next entry.


    Thanks

    Riz

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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