Results 1 to 9 of 9

Add data with a userform

Threaded View

  1. #1
    Registered User
    Join Date
    04-27-2009
    Location
    Leicester, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Add data with a userform

    I could really use some help, I am doing a 20 hour exam for ICT and have slightly over estimated my problem solving abilities!

    I really really need some help otherwise I will fail the course!

    I am using the following Macro in a UserForm to enter data into a table. I have learnt the code to use in my exam but did not think what would happen if I were to move the table. I really need some help, and would appreciate someone explaining this to me.
    Sub CommandButton1_Click()
        Columns("A").End(xlDown).Select
        ActiveCell.Offset(1, 0).Value = firstname.Text
        ActiveCell.Offset(1, 1).Value = lastname.Text
        ActiveCell.Offset(1, 2).Value = gender.Text
        Unload AddData
    End Sub
    Basically, I currently have a form at A1 to A3.
    eg:
    A B C
    1 First Name | Last Name | Gender
    2 James | Scott | Male

    As it is I can add data with a UserForm and it appears at the bottom of the table.

    I need to be able to move the form so it is not in A1. I have tried changing A to C, D etc. and that worked so I know how to change the column location but I need help getting the data into the table that is on a different row.

    I notice Columns("A") defines the Column for the text to be placed but how do I define Row?

    Please please help!
    Last edited by Leith Ross; 04-27-2009 at 12:47 PM. Reason: Added Code Tags

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