Results 1 to 11 of 11

Thread: Solved: Adding Rows in Userform

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Expert
    Joined
    May 2006
    Location
    Oklahoma City, OK
    Posts
    530
    Location

    Solved: Adding Rows in Userform

    I have a Userform thats used when calling in over-time. I want to expand the user form so that a total of 8 employees can be on the form. When the form is submitted it goes into an excel database and then is used in a pivot table. When the userform is used there may only be 4 employees on the form. When the data is moved to the database it will resemble this:

    A B C D
    EMPLOYEE OFFER DATE HOURS row1
    NAME1 Refused 6/26/2006 8 row2
    NAME2 No Answer 6/26/2006 8 row3
    NAME3 Med Disq 6/26/2006 8 row4
    NAME4 Accepted 6/26/2006 8 row5

    What I can't figure out is how to program the vba to tranfer the userform data into the rows as I described them above. Here's what I currently have and I know this doesn't work:

    "copy the data to the database
    With ws
    .Cells(lRow, 1).Value = Me.cboEmployee.Value
    .Cells(lRow, 2).Value = Me.cboOffer.Value
    .Cells(lRow, 3).Value = Me.txtDate.Value
    .Cells(lRow, 4).Value = Me.txtHours.Value
    End With

    Any help would be greatly appreciated
    Last edited by coliervile; 06-26-2006 at 04:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •