I want to use an Excel user form in conjuction with Frontpage. Is it possible for the user, upon clicking the command button to open the workbook and run the macro, never to see the actual workbook, only the userform?
Also, how can I direct the information being provided in the user form to a whole different workbook? Again, I know it will have to open it to update it but I do not want the user to see this.
To add the record, I currently have the following:
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
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
MsgBox "Record has been changed"
response = MsgBox("Do you want to change another record?", vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
Also, how can I direct the information being provided in the user form to a whole different workbook? Again, I know it will have to open it to update it but I do not want the user to see this.
To add the record, I currently have the following:
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
LastRow.Offset(1, 3).Value = TextBox4.Text
LastRow.Offset(1, 4).Value = TextBox5.Text
MsgBox "Record has been changed"
response = MsgBox("Do you want to change another record?", vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub