I'm creating a simple (i think) table and just wanted to be able to input the data on one sheet, click a command button and automatically add a new row to a table with that data.
Anyway I found a good video, followed it to a tee but got a run-time error 9 "subscript out of range"
Not sure the solution, I've tried a couple of things like making sure that my button/table/sheet name is correct.
Here's the code;
Private Sub AddNew_Click()
Dim myRow As ListRow
Dim intRows As Integer
intRows = ActiveWorkbook.Worksheets("LoanInfo").ListObjects("LoanTable").ListRows.Count
Set myRow = ActiveWorkbook.Worksheets("LoanInfo").ListObjects("LoanTable").ListRows.Add(intRows)
myRow.Range(1) = Range("B4")
myRow.Range(2) = Range("B5")
myRow.Range(3) = Range("B6")
myRow.Range(4) = Range("B7")
myRow.Range(5) = Range("B8")
myRow.Range(6) = Range("B9")
myRow.Range(7) = Range("B10")
End Sub