spreadsheet do not update

R

rach85

hello all, i'm just a beginner at excel & vB so i could use some help
here. I've this code that allows me to enter some information through
a form and it should write to a row in the sheet. Even though it says
"a record has been added!", nothing appears on the sheet. Confused by
this! Will someone help me in this? Thanks!

Private Sub CommandButton1_Click()
Dim LastRow As Object

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 I
 
D

Dave Peterson

The first post made it through ok.
hello all, i'm just a beginner at excel & vB so i could use some help
here. I've this code that allows me to enter some information through
a form and it should write to a row in the sheet. Even though it says
"a record has been added!", nothing appears on the sheet. Confused by
this! Will someone help me in this? Thanks!

Private Sub CommandButton1_Click()
Dim LastRow As Object

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
 
G

Guest

Hi Rach,
Is there any other code in any other modules? Sounds like screenupdating is
set to off.
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top