The below code should copy the details from my user form to the next available row on a seperate sheet, it currently is not coming working, it is not coming up with an error but also not working, can anyone spot the problem.
------------------------
UserForm1.Hide
Dim rw As Long
With Sheets("Amends")
'get the next avialable row in Sheet1
rw = .Range("A" & .Rows.Count).End(xlUp).Row + 1
'put the text box values in this row
.Range("A" & rw).Value = ComboBox8.Value
.Range("B" & rw).Value = TextBox19.Value
.Range("C" & rw).Value = ComboBox1.Value
.Range("F" & rw).Value = ComboBox2.Value
.Range("G" & rw).Value = ComboBox3.Value
.Range("L" & rw).Value = ComboBox6.Value
.Range("M" & rw).Value = ComboBox7.Value
.Range("D" & rw).Value = TextBox3.Value
.Range("E" & rw).Value = TextBox4.Value
.Range("H" & rw).Value = TextBox7.Value
.Range("I" & rw).Value = TextBox8.Value
.Range("N" & rw).Value = TextBox13.Value
.Range("O" & rw).Value = TextBox14.Value
.Range("P" & rw).Value = TextBox15.Value
.Range("Q" & rw).Value = TextBox16.Value
.Range("R" & rw).Value = TextBox17.Value
.Range("S" & rw).Value = TextBox18.Value
.Range("K" & rw).Value = TextBox9.Value
Application.CutCopyMode = False
End With
Dim lngWriteRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Amends")
lngWriteRow = ws.Cells(Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row
If lngWriteRow < 13 Then lngWriteRow = 13
ThisWorkbook.Save
UserForm1.Hide
End Sub
Bookmarks