wwbwb
Well-known Member
- Joined
- Oct 20, 2003
- Messages
- 513
this code I adapted from an earlier project. It's supposed to take the textboxes and put them in the first available row within the given range. But it keeps putting the information always in the same spot, overwriting anything that is there. It also ignores the fact that there is already rows that are filled. Any ideas?
Code:
Dim LastRow As Object
Set LastRow = Sheets("Details").Range("a83").End(xlUp)
LastRow.Offset(1, 1).Value = TextBox1.Text
LastRow.Offset(1, 0).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
response = MsgBox("Do you want to enter more?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub