Hi .
I have problems with this error.
I have debug the code and no error shown but when I tried to run the code it shows this error.
Attachment 828681
and error shows highlighted line
error.png
My code will be these:
Sub Reset()
Dim iRow As Long
iRow = [Counta(Database!A:A) ]
With UserForm2
.TextBox1.Value = ""
.TextBox5.Value = ""
.TextBox4.Value = ""
.TextBox3.Value = ""
.TextBox2.Value = ""
.TextBox7.Value = ""
.TextBox6.Value = ""
.TextBox8.Value = ""
.TextBox9.Value = ""
.ListBox1.ColumnCount = 9
.ListBox1.ColumnHeads = True
If iRow > 1 Then
.ListBox1.RowSource = "Database A2:J" & iRow
Else
.ListBox1.RowSource = "Database A2:J2"
End If
End With
End Sub
Sub Submit()
Dim sh As Worksheet
Dim iRow As Long
Set sh = ThisWorkbook.Sheets("Databse")
iRow = [Counta(Database!A:A)] + 1
With sh
.Cells(iRow, 1) = iRow - 1
.Cells(iRow, 2) = UserForm2.TextBox1.Value
.Cells(iRow, 3) = UserForm2.TextBox5.Value
.Cells(iRow, 4) = UserForm2.TextBox4.Value
.Cells(iRow, 5) = UserForm2.TextBox3.Value
.Cells(iRow, 6) = UserForm2.TextBox2.Value
.Cells(iRow, 7) = UserForm2.TextBox7.Value
.Cells(iRow, 8) = UserForm2.TextBox6.Value
.Cells(iRow, 9) = UserForm2.TextBox8.Value
.Cells(iRow, 10) = UserForm2.TextBox9.Value
End With
End Sub
thank you for your helps
Bookmarks