Hi all,
If I open the workbook and run the below code, it runs fine. However if I run the form and run the code a second time without reopening the workbook, I get method add of object listrows failed. I have added the listbox resource to UserForm_Initialize, any ideas?
Private Sub CmdAddEng_Click()
Dim Sh As Worksheet
Dim table_List_Object As ListObject
Dim table_object_Row As ListRow
Set Sh = Sheets("Engineers")
Set table_List_Object = Sh.ListObjects(1)
Set table_object_Row = table_List_Object.ListRows.Add
table_object_Row.Range(1, 1).Value = TxtEngName.Text
If ChkContractor.Value = True Then
table_object_Row.Range(1, 2).Value = TxtEngName.Text
End If
End Sub
Bookmarks