Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB FORMs, buttons, window properties
I have created a form in VB environment of Excel. The form is fo
people to type information in and then hit submit. The informatio then goes into the spreadsheet. This all works great! Two things, I have a button in my spreadsheet that opens the form i excel. Can you have the actual program or sheet minimize when the for is loaded? if so How? The second thing is there a way to have the submit button in the V Form submit the information and then clear the form after it i entered. I have a clear form button to do this now but would like th person who clicks can go ahead and start on a new entry. Here is th code for the button that I am using. Private Sub cmdOK_Click() ActiveWorkbook.Sheets("Sign In").Activate Range("A1").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True ActiveCell.Value = txtName.Value ActiveCell.Offset(0, 1) = txtAddress.Value ActiveCell.Offset(0, 2) = txtCity.Value ActiveCell.Offset(0, 3) = txtState.Value ActiveCell.Offset(0, 4) = txtZip.Value ActiveCell.Offset(0, 6) = txtdegree1.Value ActiveCell.Offset(0, 7) = txtdegree2.Value ActiveCell.Offset(0, 8) = txtCert1.Value ActiveCell.Offset(0, 9) = txtCert1.Value If optElementary = True Then ActiveCell.Offset(0, 5).Value = "Elementary" ElseIf optMiddle = True Then ActiveCell.Offset(0, 5).Value = "Middle School" Else ActiveCell.Offset(0, 5).Value = "Secondary" End If ANy help would be great -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB FORMs, buttons, window properties
Carla,
First part ActiveWindow.WindowState = xlMinimized UserForm1.Show Second part Just clear each control individually, like Me.Textbox1.Text = "" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "carlaruge " wrote in message ... I have created a form in VB environment of Excel. The form is for people to type information in and then hit submit. The information then goes into the spreadsheet. This all works great! Two things, I have a button in my spreadsheet that opens the form in excel. Can you have the actual program or sheet minimize when the form is loaded? if so How? The second thing is there a way to have the submit button in the VB Form submit the information and then clear the form after it is entered. I have a clear form button to do this now but would like the person who clicks can go ahead and start on a new entry. Here is the code for the button that I am using. Private Sub cmdOK_Click() ActiveWorkbook.Sheets("Sign In").Activate Range("A1").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True ActiveCell.Value = txtName.Value ActiveCell.Offset(0, 1) = txtAddress.Value ActiveCell.Offset(0, 2) = txtCity.Value ActiveCell.Offset(0, 3) = txtState.Value ActiveCell.Offset(0, 4) = txtZip.Value ActiveCell.Offset(0, 6) = txtdegree1.Value ActiveCell.Offset(0, 7) = txtdegree2.Value ActiveCell.Offset(0, 8) = txtCert1.Value ActiveCell.Offset(0, 9) = txtCert1.Value If optElementary = True Then ActiveCell.Offset(0, 5).Value = "Elementary" ElseIf optMiddle = True Then ActiveCell.Offset(0, 5).Value = "Middle School" Else ActiveCell.Offset(0, 5).Value = "Secondary" End If ANy help would be great! --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I use properties window to embed shockwave flash file? | Excel Worksheet Functions | |||
Docking Project Explorer, Properties window and Code window in VBE | Setting up and Configuration of Excel | |||
Forms buttons | Excel Discussion (Misc queries) | |||
Properties window show nothing for a userform | Excel Discussion (Misc queries) | |||
Command Buttons on XL User Forms | Excel Programming |