Article ID: 161514
Article Last Modified on 10/10/2006
A1: Name B1: ID C1: Phone
Control Caption property
--------------------------
Label1 Name
Label2 ID
Label3 Phone
Control Caption property
---------------------------------
CommandButton1 Add Record
CommandButton2 Exit
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
End Sub
Private Sub CommandButton2_Click()
End
End Sub
Sub Show_UserForm()
UserForm1.Show
End Sub
120802 OFF: How to Add/Remove a Single Office Program or Component
Additional query words: XL97
Keywords: kbdtacode kbprogramming kbualink97 KB161514