I found the following sub for adding a new record with multiple fields to a table, but it keeps bombing out at the row that reads:
Set lastRow = table.ListRows(table.ListRows.Count).Range
With an error:
Run-time error '9':
Subscript out of range
The only modifications I made to it were:
I selected the sheet that has the table on it just after the Dim statements
In the next two lines I entered the name of the worksheet, then the name of the table.
I am passing to it a table name that is a string tblRecordLog, and a 5 item array called Values(), as in:
Call AddDataRow("tblRecordLog", Values())
Also I found if I didn't put the word "Call" in there it showed that line as an error (Which I don't understand either as I am used to not having to first type "Call"!).
Can anyone spot what is going wrong, let my know why, and how to fix?
Still learning much by fire, appreciate the help immensely.Please Login or Register to view this content.
Bookmarks