+ Reply to Thread
Results 1 to 3 of 3

Data Entry with UserForm

Hybrid View

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

    Data Entry with UserForm

    Hello:

    Please refer to attached sheet.
    I am trying to create a very simple userform to enter First Name and Last Name .
    While pressing the "Submit button, it gives error.
    Can someone help on this simple task.
    Below is the capture code I am using.

    Private Sub CommandButton1_Click()
    Dim erow As Integer
    erow = Sheet1.Cells(Rows.Count, 1).End(x1up).Offset(1, 0).Row
    Cells(erow, 1) = TextBox1.Text
    Cells(erow, 2) = TextBox2.Text
    End Sub
    Let me Know if you have any questions.
    Thanks.


    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Data Entry with UserForm

    Private Sub CommandButton1_Click()
    Dim erow As Long
    erow = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Cells(erow, 1) = TextBox1.Text
    Cells(erow, 2) = TextBox2.Text
    End Sub
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Data Entry with UserForm

    Hi Riz,

    One is not equal to "L" in your .End(x1up). If you replace the "1" by an "l" you will have better luck with your error message. I found this because the "up" didn't change to "Up" after pressing enter.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  2. Userform data entry
    By amekock in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-19-2011, 10:26 AM
  3. Data entry with userform
    By gr6au in forum Excel General
    Replies: 1
    Last Post: 10-16-2010, 10:08 AM
  4. Data entry using a userform
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2010, 08:59 PM
  5. [SOLVED] userform data entry
    By john tempest in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2006, 10:45 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