Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use properties window to embed shockwave flash file? Melvin P[_2_] Excel Worksheet Functions 0 November 30th 07 03:24 AM
Docking Project Explorer, Properties window and Code window in VBE jayray Setting up and Configuration of Excel 2 March 27th 07 04:42 PM
Forms buttons Trebor Retrac Excel Discussion (Misc queries) 3 September 11th 06 05:37 PM
Properties window show nothing for a userform Cheer-Phil-ly Excel Discussion (Misc queries) 0 July 27th 06 07:15 PM
Command Buttons on XL User Forms Hotbird Excel Programming 2 August 6th 03 01:42 PM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"