Results 1 to 18 of 18

User Form not adding data

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    User Form not adding data

    I made a user form to enter the data but I cannot get the data to copy to the worksheet.

    The worksheet is named "WOODS" and the data should be entered in the first available blank row, starting with column "B".

    Here is he code I tried but as of yet when I try to run the code nothing happens.

    Private Sub ComandButton1_Click()
    Dim iRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("WOODS")
    
    'switch off ScreenUpdating to speed up code & prevent flickering
        Application.ScreenUpdating = False
    
    'find first empty row in database
       iRow = ws.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
    
    'copy the data to the database
       ws.Cells(iRow, 2).Value = Me.TextBox1.Value
       ws.Cells(iRow, 3).Value = Me.TextBox2.Value
       ws.Cells(iRow, 4).Value = Me.TextBox3.Value
       ws.Cells(iRow, 5).Value = Me.TextBox4.Value
    
    End If
    End Sub
    Any help would be wonderful.

    Jim O
    Last edited by JO505; 02-05-2013 at 06:14 PM.

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