You are on page 1of 8

Excel Forms Sample Workbook

How to Use This Workbook

How to use this workbook


This workbook contains examples of different types of forms. Instructions on each sheet explain what Excel features were used and how the form was created. You can use these sample forms to: Experiment with the features, and get ideas for your own forms. Copy elements you like from the sample forms to your own forms. Copy an entire form and modify it to create your own form. To make these instructions easy for you to follow, click Print on the File menu, click Entire Workbook under Print what, and then click OK. Example forms Each example form is on a separate worksheet. Printed Form is set up to resemble a hardcopy form, so that you can fill in the information onscreen and then print it out. Data Entry Form is designed for online data entry. It uses features like data validation, comments, and worksheet protection to help the user enter the data the form designer wants. Automated Form shows you how to add controls to a form. If you're a programmer you can then write macros or a Web script to automate the controls, and make the form part of a Visual Basic for Applications (VBA) program or a Web site that gathers data. Web Form contains a form that you could publish from Excel to a Web page on your intranet to let people do sophisticated data entry and calculations. Using the examples in your own workbooks To use an example form, you can copy cells, formatting, or the entire worksheet to your own workbook. To copy a worksheet, click the sheet, click Move or Copy Sheet on the Edit menu, click the destination workbook in the To book box, and then select the Create a copy check box. After copying the worksheet, you can delete the yellow instruction box from the copy by clicking it and pressing the DELETE key. After modifying one of the examples, you can save your version as a template to make it easy to base new forms on it. Click Save As on the File menu, click Template in the Save as type box, and then use the Save in box to store the template in your Templates folder or in a shared network folder for others to use. For more information about creating and using templates, ask the Excel Answer Wizard about templates. For more information Excel Help has further information about forms. Ask the Excel Answer Wizard about forms, or search for forms information on the Office Update Web site.

Page 1

Excel Forms Sample Workbook

Printed Form

Quote No.

4719101585

One Portals Way, Twin Points, WA 98158 Phone: 1-206-555-1417 Fax: 1-206-555-5938

SALES QUOTE
Customer
Name: Address City/St./Zip Phone

Bergstad's Scandinavian Grocery 41 S. Marlon St., Suite 2 Seattle, WA 98104 206-555-3453

Date: July 12 Sales Rep: N. Davolio Accept/Reject:

Description Fish Roe, 12 - 200 ml jars White Chocolate, 12 - 100 g bars 20% discount at quantity 101 - 500

Unit Price $20.00 $20.00

11 - 50 $29.45 $15.44

51 - 100 $27.90 $14.63

101 - 500 $26.35 $13.81

Terms and Conditions Quote good for 30 days. Orders in excess of 50 units subject to availability. Shipment F.O.B. port of Seattle, WA. Terms 2% net 15.

###

This quote is proprietary and confidential.

Page 2

Excel Forms Sample Workbook

Printed Form

Page 3

Excel Forms Sample Workbook

Printed Form

This example shows how easy it is to reproduce your company's printed forms in Excel. You can make the online version look just like the printed version, and you can set it up so that it looks good on paper, too. The example has data keyed in, but you could create a form like this that's blank, and to replicate it you could either print copies or save it as a template. Most of the work with a form like this involves formatting. Here's how the form was constructed. Gridlines Gridlines were turned off for the sheet: click Options on the Tools menu, click the View tab, and then clear the Gridlines check box under Window options. Graphic elements Logo The Northwind Traders logo was a separate graphic file that was imported (point to Picture on the Insert menu, and then click From File). The logo has a thin black border: to see how this was applied, try clicking the logo, then click Picture on the Format menu and click the Colors and Lines tab. Rounded-corner boxes The blue boxes with rounded corners around the address and sales rep information are autoshapes. To create a similar shape, display the Drawing toolbar, point to Basic Shapes on the AutoShapes menu, and click the rounded rectangle shape. Drag on the worksheet to draw the rectangle size you need. Click and drag the yellow diamond at the upper left of the rectangle to adjust the curvature of the corners. Then format the rectangle with a thick, dark blue border and transparent fill: click AutoShape on the Format menu, click the Colors and Lines tab, and then set 100% transparency and the line color, style, and weight you want. Text boxes At the bottom of the form, the gray "Proprietary and confidential" box is a text box with a black border, gray shading, and formatted text. The company name, address, and fax at the top are also in a text box, but one with the border turned off and 100% transparent fill. Text boxes make it easy to reposition and center a separate piece of text. To create a text box, click the Text Box tool on the Drawing toolbar, drag the approximate size you need, type your text, and then use the sizing handles to adjust the box size. To format the text box, click its border and then click Text Box on the Format menu. Use the Colors and Lines tab to set the fill color and line weight and style; the Font tab to set the text font, size, and color; and the Margins tab to adjust the spacing between the text and the borders.

Page 4

Excel Forms Sample Workbook

Printed Form

Cell formatting and fonts Stripes The thick blue stripe with a thin stripe below are cell borders. First cells C11:J11 were formatted with a thick, dark blue lower border. Then cells D13:J13 were formatted with a thin, dark blue upper border, and the row height for row 12 was reduced to 4 pixels to bring the two stripes together. To add borders to cells, select the cells, click Cells on the Format menu, and then click the Border tab. The words "Sales Quote" are in a text box with a white background. Positioning this text box over the cells with borders makes it look like the stripes are interrupted. Blanks to fill in The thin black lines in the body of the form, and the lines for the address and other information in the rounded blue boxes, are also cell borders. You could use lines like this to create blanks if you want the form to be filled in by hand. Merged cells In the body of the form, the cells in the Description column spanning columns D and E are merged cells. To merge cells, select the cells to combine, click Cells on the Format menu, click the Alignment tab, and then select the Merge Cells check box. Fonts and colors The form uses several different font sizes and colors, such as the bold red quote number. To change font for a cell, click the cell, click Cells on the Format menu, and then click the Font tab.

Page 5

Excel Forms Sample Workbook

Data Entry Form

Acct #

Account Description

Actual

Budget

Subcontractors & Services 201 Telecommunication Services 202 Design Consultants 203 Photo/Video Services 250 Graphic Services 251 Photo/Stats 252 Typesetting (enter more accounts here) (enter more accounts here) 436 500 45 765 568 388 500

This example illustrates several features that help with online data entry. Protection The worksheet is protected, so that you can only enter data in the blue-shaded cells. To see how protection works, try to change one of the cells in the Actual column. As soon as you start typing, a message tells you the cell is protected. To turn protection off, point to Protection on the Tools menu, and then click Unprotect Sheet. You can type in the blue-shaded cells because they were unlocked before the sheet was protected. Click a blue-shaded cell, and then click Cells on the Format menu (this command won't be available if you haven't unprotected the sheet). Click the Protection tab, and you'll notice that the Locked check box is unchecked. Cells are locked by default. The Hidden check box determines whether the formula in a cell is hidden or displayed when the sheet is protected. You can also click the Border and Patterns tabs to see how the blue shading and gray borders were set up for these cells. To turn sheet protection back on, point to Protection on the Tools menu and click Protect Sheet. For your own worksheets, be sure to type a password, so that users who don't have the password won't be able to unprotect the sheet. No password was assigned when this example sheet was protected, so that you can easily unprotect it. Comments Point to cell D3 or D14, which have red triangles in the corner, and you'll see a yellow comment box with a message from the accounting department. Comments are a good way to provide instructions for an online form. To add a comment to a cell, click the cell, and then click Comment on the Insert menu (this command won't be available if you haven't unprotected the sheet). Data validation Several cells on the form use data validation to provide instructions and specifications for the data to be entered. Click cell A9, and try to enter a large number, such as 1000. The cell only accepts values in the range suggested by the message that appears when you click the cell. Now click cell B9, and click the dropdown arrow that appears to the right of the cell. This list of account names was also provided using data validation. To see how the data validation was set up, click cell A9 or B9 and then click Validation on the Data menu (this command won't be available if you haven't unprotected the sheet--as you can see, sheet protection is a powerful feature!). The three tabs of the Data Validation dialog box define the settings for the cell and the messages that appear when you click it and enter incorrect data. If you look at the Settings tab for cell B9, you'll notice the list of account names is defined to be in cells B28:B35. But if you scroll down to look at those cells, you'll notice the rows are hidden. With the sheet protected, users can't unhide these rows to see where you've stored the list, making unauthorized changes that much more difficult. Excel Help has additional information about data validation, and there's a sample data validation workbook available for download from Office Update that has detailed instructions on setting up and using data validation. For more information, ask the Excel Answer Wizard about data validation.

Supplies and Materials 301 Office Supplies 302 Office Postage 303 Office Equipment & Furniture 304 Miscellaneous Supplies 500 45 765 568

Facilities Overhead 405 Plant 410 Office Rental 415 Lab 1700 1200 300

Totals

7780

500

Page 6

Excel Forms Sample Workbook

Automated Form

Payment

Check is enclosed

Bill me later

This example shows how you can use controls on a form. A control is an element, such as a check box, a list box, or a button, that offers options to users or runs macros or scripts that automate a task. Creating controls

Send information about

Europe Far East South America

North America Africa Russia

Types of controls The controls on this form are ActiveX controls that were added using the Control Toolbox, which is a toolbar containing controls and related commands. Although Excel allows you to use other types of controls, ActiveX controls are the recommended type because they provide you with the most features and options and can be used in most situations. In addition to the built-in ActiveX controls on the toolbar, you can install more ActiveX controls on your system and then click the More Controls button to add them to your form. The example form uses the built-in Check Box and Option Button controls. Working with controls Try clicking the controls to check or uncheck the check boxes or turn the option buttons on and off. To add a control, you display the Control Toolbox toolbar, click the button for the control you want, and then drag a rectangle on the worksheet. After typing the text you want and adjusting the size of the control, you can right-click the control to set its properties, such as the font and colors or the shape of the mouse pointer when users point to the control. To change existing controls later on, you can click the Design Mode button on the Control Toolbox toolbar. Using drawing tools with controls Using tools on the Drawing toolbar you can position and format controls and draw boxes to group controls. To align controls horizontally and vertically like the example, click Draw on the Drawing toolbar, point to Snap, and then click To Grid. When you drag controls to position them, the controls will then align with an invisible grid. Once the controls are aligned, you can position an entire group of controls, such as the six check boxes, by grouping them. Hold down SHIFT, click each of the controls you want to group, click Draw, and then click Group. Automating controls After you add and arrange your controls, you need to automate them, for instance, to allow users to select one of two option buttons or check as many of the check boxes as they want. You'll also want to write a program or script that acts on the user's choices when the user is finished interacting with the controls. The method you use to automate ActiveX controls depends on how you plan to use your form. VBA macros If you're using the form in Excel or as part of a Visual Basic for Applications (VBA) program, you can write macros to detect when a user clicks a control and respond accordingly. When you add a control to a worksheet, a new VBA subroutine is automatically created for the control. These subroutines are the reason why you may receive a warning about macros when you open the sample workbook (the macros in the sample workbook don't do anything). You can use the Visual Basic Editor to write the macros you need to automate the controls. Web scripts If your form will be used on a Web page, you can write a Web script to automate the controls. You can use the Microsoft Script Editor to write the script and store it with the worksheet. When you publish the form to the Web page, Excel also publishes your script. For more information about Web scripts and publishing, see the Web Form worksheet in this workbook. For more information Excel Help has more information about adding and using controls. Ask the Excel Answer Wizard about controls.

Page 7

Excel Forms Sample Workbook

Web Form

Mortgage Loan Analysis


Down Payment Interest Rate Term (months) Loan Amount Payments Total Interest None 10.0% 360 $80,000 $702.06 $172,741

This example show how you can set up a form in Excel to publish to a Web page. Publishing to a Web page is one of the easiest ways to take advantage of your intranet to make your form available to other people in your company. Preparing the form You can use all of the Excel formatting and Drawing toolbar features illustrated in this workbook to prepare your Web form. The example uses colors, fonts, cell shading, and autoshapes to make the form look inviting on the Web page. When you publish the form, Excel automatically retains your formatting and converts it to HTML for you. Automating the form To make the Web form respond correctly when users fill it out, the form needs to have a Web script that runs on the user's system and submits the information entered by the user, and your Web server needs to have a script or program to process the received information. You can use Excel to create the Web script that would send the user's entries in the two blanks on the example form to your Web server when the user clicks the Submit button. Point to Macro on the Tools menu, and then click Microsoft Script Editor. To learn more about writing Web scripts, see Help in the Microsoft Script Editor. Your server administrator or webmaster can help you set up the server scripts or programs you need to process the information users submit with your forms. Adding interactivity If you aren't expert at writing Web scripts, you can still use Excel to create interactive Web forms. When you publish a form, you can make all or part of it interactive. For example, if you add interactivity for cells C5:C10, users who visit your Web page can enter different interest rates, terms, and loan amounts to see what their payments and total interest would be. The interactivity is provided by an Office Web Component. The Spreadsheet component allows users on your intranet who have Office licenses to use many of the features Excel offers, from your Web page displayed within Internet Explorer. Adding interactivity is easy: you select the range you want to make interactive and then specify the Add interactivity option when you save the form as a Web page. Publishing the form When you're ready to create the Web page for your form, click Save as Web Page on the File menu. In the Save As dialog box, click any options you want, including interactivity, or you can click the Publish button if you need more control over how the form is published. For the example form, you might click Publish and then designate sections with and without interactivity. When you're finished specifying your settings, Excel automatically converts your form to HTML and saves it as a Web page. Excel also makes it easy to republish your form, retaining all your publishing settings as part of the workbook, so that you can maintain and update the form in Excel and republish it periodically to the Web page. Using an HTML editor When you view your new Web page in your browser, you'll probably want to make some additional changes to further customize it. You can modify the published form as you would any other Web page in an HTML editor such as Microsoft FrontPage. For example, the Spreadsheet component used for interactivity has many features and settings you can adjust, such as protecting some of the cells and displaying or hiding the toolbar of user commands. In FrontPage, you could click the Help button on the Spreadsheet toolbar for information about the capabilities and settings the component provides.

Enter the amount you want to borrow here: Enter the rate you're applying for here: To apply for the loan, click the Submit button:

20000

5
Submit

Page 8

You might also like