I have a sheet called Quotation with a table in it called Quotation
Through a UserForm [frmNewDocument] I add items to that table
The problem I have is that my code seems to ignore the first row, add a new row then enters the data
My code is:
How do I get it to enter the data in the first empty row then add new row for next item?
Many thanks
Through a UserForm [frmNewDocument] I add items to that table
Quotes ^0 Invoices.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
17 | Product # | Category | Item Description | Price | UOM | Quantity | Total Value | ||
18 | |||||||||
19 | 10000008 | Cables | 10mm Round Clips | £ 1.00 | each | 10 | £ 10.00 | ||
Quotation |
The problem I have is that my code seems to ignore the first row, add a new row then enters the data
My code is:
Code:
Private Sub More_Yes()
Dim ws As Worksheet
Dim tbl As ListObject
Dim newRow As ListRow
Set ws = Sheets("Quotation")
Set tbl = ws.ListObjects("Quotation")
Set newRow = tbl.ListRows.Add
With newRow
.Range(1) = txtProductID
.Range(2) = cmbCategory
.Range(3) = cmbDescription
.Range(4) = txtPrice.Value
.Range(5) = txtUOM
.Range(6) = txtQty
.Range(7) = txtTotal.Value
End With
Call ClearItemsSheet
End Sub
How do I get it to enter the data in the first empty row then add new row for next item?
Many thanks