+ Reply to Thread
Results 1 to 2 of 2

Userform database

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    15

    Userform database

    Hi everyone,

    I am trying to build a new database in Excel for students to submit any issues they have. Can someone provide me with the VBA code where I can save all the information in a spreadsheet like a database. I just managed to save information in 1 row. How can I build a database which data can be saved from the 1 row to infinity.

    This is the code I am using (interface is built in userform)


    Private Sub CommandButton1_Click()
    Sheet2.Activate
    eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    Cells(eRow, 3) = Creator.Text
    Cells(eRow, 4) = ComboBox1.Value
    Cells(eRow, 7) = Region.Text
    Cells(eRow, 9) = TextBox4.Text
    Cells(eRow, 2) = TextBox9.Text
    Cells(eRow, 6) = ComboBox2.Value
    Cells(eRow, 8) = ComboBox3.Value
    Cells(eRow, 10) = TextBox5.Text
    Cells(eRow, 5) = TextBox6.Text
    Cells(eRow, 11) = TextBox7.Text
    Cells(eRow, 12) = TextBox8.Text

    Thanks for your help

    Gordon

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Userform database

    That will save the information in the last empty row every time you click the button. What else would you like it to do?

    One thing I noticed... you're finding the last row on sheet1 and then placing values in sheet2?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ 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. Customer Database using userform
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 08:22 AM
  2. Search Through Database And Display Results In Userform without showing database
    By nirvanarapeme in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2012, 05:18 PM
  3. VBA UserForm Database Question
    By jmk8602 in forum Excel General
    Replies: 2
    Last Post: 11-13-2011, 04:15 AM
  4. database to userform
    By excelkt in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 09-02-2011, 10:14 AM
  5. Userform to Fill Database
    By Jasper in forum Excel General
    Replies: 2
    Last Post: 02-24-2005, 05:06 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