Results 1 to 3 of 3

Add Data To Table (currently not Adding a row to the Table)

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    3

    Add Data To Table (currently not Adding a row to the Table)

    hi,

    I need to add data into a Table, i can currently add data to the last cell however it is not adding it in the table set,

    i am using a userform to add the data into the next blank cells, however the data it entered is not added within the table but underneath it, here is my current code i am using

    please assist in guiding me on how to let the data fall within the table

    Private Sub CommandButton1_Click()
              Dim LastRow As Object
                 Dim myPWD As String
                     myPWD = "Test"
                         Sheets("Child_name").Unprotect Password:=myPWD
              
              Set LastRow = Sheets("Child_name").Range("a65536").End(xlUp)
    
              LastRow.Offset(1, 0).Value = TextBox1.Text
              LastRow.Offset(1, 1).Value = TextBox2.Text
              LastRow.Offset(1, 2).Value = TextBox6.Text
              LastRow.Offset(1, 3).Value = TextBox4.Text
              LastRow.Offset(1, 4).Value = TextBox5.Text
              LastRow.Offset(1, 5).Value = TextBox3.Text
              If CheckBox1.Value = True Then
                LastRow.Offset(1, 6).Value = "Yes"
                    Else
                        LastRow.Offset(1, 6).Value = "No"
                    End If
                    
                   MsgBox "Record Added"
    
              response = MsgBox("Do you want to enter another record?", _
                  vbYesNo)
    
              If response = vbYes Then
                  TextBox1.Text = ""
                  TextBox2.Text = ""
                  TextBox3.Text = ""
                  TextBox4.Text = ""
                  TextBox5.Text = ""
                  TextBox6.Text = ""
                  CheckBox1.Value = False
    
                  TextBox1.SetFocus
    
              Else
                  Unload Me
                  
                                
              End If
                    Sheets("Child_name").Protect Password:=myPWD
          
                End Sub
    Last edited by Tinyt; 02-02-2014 at 12:03 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Expand a table by adding rows ( table feature 2007 and later)
    By Pepe Le Mokko in forum Excel General
    Replies: 3
    Last Post: 08-13-2013, 05:12 AM
  2. Help Adding up data from a table
    By skate1991 in forum Excel General
    Replies: 5
    Last Post: 06-29-2012, 06:36 AM
  3. Adding formula to active table and for pivot table in macro
    By Jerseynjphillypa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2012, 08:12 AM
  4. Adding data to a table, from another table..reverse vlookup??
    By Speshul in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-24-2012, 04:06 AM
  5. Pivot Table - Adding New Data
    By Chard in forum Excel General
    Replies: 2
    Last Post: 08-07-2006, 02:44 PM

Tags for this Thread

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