Thursday, February 24, 2005

Creating Custom Forms in Excel

The last activity that we'll be doing today is creating a Userform for our StudentRecords application. First, add a new column to your StudentRecords spreadsheet where you can select whether the student is Male or Female.

Now see if you can figure out how to create a UserForm from the VBA editor. Try out all the different options and create a form that will be able to be used to add information to our Student Records. Be creative! You can change the colours of the form, you can make the background of your form an image, or even add images to buttons... the sky is the limit!

For those who get ahead, see if you can add some VBA code to your OK button that will add the info from your form to the spreadsheet. Double click on your forms OK button to create a macro for the button. You'll then need to use the Cells VBA function, which allows you to set the value of a specific cell. For example:
  • Cells(2, 1) = TextBox1
Try it out!

0 Comments:

Post a Comment

<< Home