Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hello, Good afternoon please can you help me I have the code below where I am trying to add N/a to the empty textboxes in my userform if not filled but I am getting an error, please can you help me? I am getting an error on
Code:
Conventional.Show
Code:
Private Sub CommandButton3_Click()
Dim emptyRow As Long
With ThisWorkbook.Sheets("Handover")
emptyRow = Cells(Rows.Count, "H").End(xlUp).Row + 1
.Cells(emptyRow, 8).Value = TextBox8.Value
.Cells(emptyRow, 9).Value = TextBox14.Value
.Cells(emptyRow, 10).Value = TextBox7.Value
.Cells(emptyRow, 11).Value = TextBox5.Value
.Cells(emptyRow, 12).Value = TextBox3.Value
.Cells(emptyRow, 13).Value = ComboBox5.Value
.Cells(emptyRow, 14).Value = ComboBox3.Value
.Cells(emptyRow, 15).Value = TextBox9.Value
.Cells(emptyRow, 16).Value = ComboBox1.Value
.Cells(emptyRow, 22).Value = TextBox11.Value
.Cells(emptyRow, 20).Value = TextBox12.Value
.Cells(emptyRow, 21).Value = TextBox13.Value
.Cells(emptyRow, 23).Value = ComboBox4.Value
.Cells(emptyRow, 25).Value = TextBox15.Value
On Error Resume Next
.SpecialCells(xlCellTypeBlanks).Value = "n/a"
On Error GoTo 0
End With
Conventional.Show
Unload Me
End Sub