
Originally Posted by
nathansav
Worksheets("2014").Range("D" & LastRow).Value = tbNetSales.Value etc
Thank you nathansav for your help. I've fixed my code per your advice, and now I am receiving this error:
Application-defined or object-defined error
Did I forget to define something?
Here is my updated code:
Private Sub btnOkay_Click()
Dim LastRow As Long
'Adds 1 to get to the Row following the last populated Row
LastRow = Worksheets("2014").Cells(Rows.Count, 1).End(xlUp).Offset(1)
Worksheets("2014").Range("D" & LastRow).Value = tbNetSales.Value
Worksheets("2014").Range("G" & LastRow).Value = tbDiscounts.Value
Worksheets("2014").Range("P" & LastRow).Value = tbCreditCards.Value
End Sub
Bookmarks