Results 1 to 15 of 15

Create New row in a table and copy/update formulas VBA

Threaded View

  1. #1
    Registered User
    Join Date
    07-22-2012
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    11

    Lightbulb Create New row in a table and copy/update formulas VBA

    Hi, I'm new to VBA

    I've got my excel table that uses certain formulas to calculate values for some cells.
    I use UserForm to fill in that table however when new row with input from the form gets added to the table it does not inherit updated formulas from the row above. Therefore no calculations are taking place in that row. I use the following code to insert a new row with UserForm data:

    Private Sub submit_Click()
    
    Dim nextrow As Integer
    
    nextrow = WorksheetFunction.CountA(Sheets("Data").Range("B:B")) + 1
    
    Sheets("Data").Cells(nextrow, 2) = DTPicker1.Value
    Sheets("Data").Cells(nextrow, 3) = odo.Value
    Sheets("Data").Cells(nextrow, 8) = fuel.Value
    Sheets("Data").Cells(nextrow, 9) = price.Value
    Sheets("Data").Cells(nextrow, 14) = ComboBox1.Value
    Sheets("Data").Cells(nextrow, 15) = notes1.Value
    
    Unload fillupEntry
    
    End Sub
    Any help would be greatly apreciated. Thanks
    Last edited by whitenoise22; 07-22-2012 at 05:05 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