M
Marcus Pedersén
Hi!
I use the following code but I get an error(424) Object required and I can´t
figure it out. Please help!! Error line marked with *
Option Explicit
Private Sub CommandButton1_Click()
Dim LastRow As Range
Dim response As Long
* Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
MsgBox "One record written to Sheet1"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
Many thanks in advance!!
Marcus
I use the following code but I get an error(424) Object required and I can´t
figure it out. Please help!! Error line marked with *
Option Explicit
Private Sub CommandButton1_Click()
Dim LastRow As Range
Dim response As Long
* Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text
MsgBox "One record written to Sheet1"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
Many thanks in advance!!
Marcus