Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with vba user form
I am learning how to add a user form
I'm following a knowledge base article # 213749 I've set up the user form every thing seems to be right except I'm getting an compile error message at Set LastRow = Sheet1.Range("A65536").End(x1Up) Here is the code from the instructions: Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Sheet1.Range("A65536").End(x1Up) 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 sheet 1" response = MsgBox("Do you want to enter another record?", vbYesNo) If response = vbYes Then TextBox1.Text = "" TextBox2.Text = "" TextBox.Text = "" TextBox1.SetFocus Else Unload Me End If End Sub Private Sub CommandButton2_CLick() End End Sub Can anyone tell me what's wrong Is there a mistake in the code or am I doing something wrong? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with vba user form
Hi Dave
it's XLUP not X1UP the letter L not the number 1 Cheers JulieD "Dave W" wrote in message ... I am learning how to add a user form I'm following a knowledge base article # 213749 I've set up the user form every thing seems to be right except I'm getting an compile error message at Set LastRow = Sheet1.Range("A65536").End(x1Up) Here is the code from the instructions: Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Sheet1.Range("A65536").End(x1Up) 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 sheet 1" response = MsgBox("Do you want to enter another record?", vbYesNo) If response = vbYes Then TextBox1.Text = "" TextBox2.Text = "" TextBox.Text = "" TextBox1.SetFocus Else Unload Me End If End Sub Private Sub CommandButton2_CLick() End End Sub Can anyone tell me what's wrong Is there a mistake in the code or am I doing something wrong? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with vba user form
you're welcome and thanks for the feedback
wrote in message ... Thank you -----Original Message----- Hi Dave it's XLUP not X1UP the letter L not the number 1 Cheers JulieD "Dave W" wrote in message ... I am learning how to add a user form I'm following a knowledge base article # 213749 I've set up the user form every thing seems to be right except I'm getting an compile error message at Set LastRow = Sheet1.Range("A65536").End(x1Up) Here is the code from the instructions: Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Sheet1.Range("A65536").End(x1Up) 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 sheet 1" response = MsgBox("Do you want to enter another record?", vbYesNo) If response = vbYes Then TextBox1.Text = "" TextBox2.Text = "" TextBox.Text = "" TextBox1.SetFocus Else Unload Me End If End Sub Private Sub CommandButton2_CLick() End End Sub Can anyone tell me what's wrong Is there a mistake in the code or am I doing something wrong? . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with vba user form
Thank you
-----Original Message----- Hi Dave it's XLUP not X1UP the letter L not the number 1 Cheers JulieD "Dave W" wrote in message ... I am learning how to add a user form I'm following a knowledge base article # 213749 I've set up the user form every thing seems to be right except I'm getting an compile error message at Set LastRow = Sheet1.Range("A65536").End(x1Up) Here is the code from the instructions: Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Sheet1.Range("A65536").End(x1Up) 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 sheet 1" response = MsgBox("Do you want to enter another record?", vbYesNo) If response = vbYes Then TextBox1.Text = "" TextBox2.Text = "" TextBox.Text = "" TextBox1.SetFocus Else Unload Me End If End Sub Private Sub CommandButton2_CLick() End End Sub Can anyone tell me what's wrong Is there a mistake in the code or am I doing something wrong? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
User form | Excel Programming | |||
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form | Excel Programming | |||
User Form | Excel Programming |