+ Reply to Thread
Results 1 to 2 of 2

Userforms - To populate data on a specific sheet and columns

Hybrid View

  1. #1
    Registered User
    Join Date
    03-22-2014
    Location
    Manila
    MS-Off Ver
    Excel 2003
    Posts
    25

    Userforms - To populate data on a specific sheet and columns

    Hi All, i'm having a hard time with trying to populate data from a userform to a specific column under a specific sheet. I've attached the file if you want to look at it. The file is basically a exam type with user logging and auto score computing.

    The file is made of 6 sheets, 1st sheet is the log-in page where takers are required to enter their ID number and last name. 3 sheets of dummy test items, an Admin sheet that computes the score per test item and Database which I'm trying to compile all data in one column.

    What I'm trying to do is that when they enter their ID and Last Name and then answer the 3 tests, they will be recorded in the database sheet in 1 column containg their ID, name and all the test results so that checking,grading and identifying who took the test would be easy.

    So far I think I've done the part for the scores but I can't seem to get the userform for emp# and last name to populate on the field marked in the database.

    Please help...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Userforms - To populate data on a specific sheet and columns

    This code is no good:
    Private Sub TextBox1_Change()
    
    Cells(emptyRow, 1).Value = TextBox1.Value
    Cells(emptyRow, 2).Value = TextBox2.Value
    
    End Sub
    I think you may be trying to do something like this:
    Private Sub okemp_Click()
    Dim ws As Worksheet:    Set ws = Sheets("Database")
    Dim lastrow As Long
    
    lastrow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
    
    If TextBox1.Value <> "" And TextBox2.Value <> "" Then
        ws.Range("A" & lastrow).Value = TextBox1.Value
        ws.Range("B" & lastrow).Value = TextBox2.Value
    Else
        MsgBox ("you must enter an ID# and Name")
    End If
    Application.Goto Worksheets("Test 1").Range("A1")
    
    End Sub

    Note: You are probably going to have a few problems with the code in the future. You might want to consider such things as sheet references, error checking, etc. If this spreadsheet is part of your work or a profesional function, I would consider paying for someones services to help you build it completely.

+ 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] Populate summary sheet with values within specific month column on data sheet...
    By blue91 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-12-2013, 12:11 PM
  2. Replies: 0
    Last Post: 04-16-2013, 07:29 AM
  3. Auto-populate specific data from one sheet to another
    By arskiracer in forum Excel General
    Replies: 0
    Last Post: 10-17-2012, 10:27 PM
  4. Auto-populate specific data from one sheet to another
    By fowlspace in forum Excel General
    Replies: 4
    Last Post: 10-17-2012, 09:19 PM
  5. Replies: 21
    Last Post: 05-26-2012, 06:09 PM

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