Active Member
March 24, 2020
Hi,
I have a user form which inputs I want to go into a table. When I submit the form, I keep getting a run-time error '9': subscript out of range.
I am using Philip Treacy's tutorial and the code seems to have the problem with adding a row to my table section and I'm running into a wall here.
Thank you!
October 5, 2010
Hi Katy,
You have a couple of lines of code referring to your table:
ActiveSheet.ListObjects("ESDCheckForm").ListRows.Add
Set Table1 = ActiveSheet.ListObjects("ESDCheckForm")
but your table (on the worksheet) is named Table1 not ESDCheckForm, this is what's causing the subscript out of range error
Also, when adding data from the form to the table, there are some lines of code (in red) that are trying to read values from fields in the form that don't exist:
.Cells(1, 1) = NameList.Value
'.Cells(1, 2) = Calender1.Value
.Cells(1, 3) = MatNumber.Value
'.Cells(1, 4) = ConductivityValue.Value
.Cells(1, 5) = CheckConductivity.Value
'.Cells(1, 6) = GroundingValue.Value
.Cells(1, 7) = GroundCheck.Value
.Cells(1, 8) = ESDCheck.Value
.Cells(1, 9) = Comments.Value
Please see attached file for working code.
Regards
Phil
Answers Post
1 Guest(s)