Designing the Worksheet

A word search puzzle is created on a worksheet—the design of which is shown in Figure 7.17. A worksheet makes an ideal interface for this program since it is easy to write letters to the cells and print a portion of the worksheet (as you will see in the program code).

Merged cells Puzzle grid

Merged cells

The Word Find worksheet interface.

Merged cells Puzzle grid

Merged cells

The Word Find worksheet interface.

Combo Box control

Command Button controls

List Box control

Merged cells

Command Button controls

Combo Box control

Command Button controls

List Box control

Merged cells

Command Button controls

As was done with the form, the worksheet contains a Combo Box and List Box control for displaying the topic and word lists, respectively. The data listed in the ActiveX controls on the puzzle worksheet will be read only from the hidden worksheet and not from the data file. Nothing is included directly on the worksheet that will allow the user to edit the data file. Instead, a Command Button control with the caption Update Lists is used to show the form that updates the data file. Other Command Button controls added to the worksheet include the following:

• Clear All: Clears data from the puzzle and ActiveX controls.

• Refresh: Refreshes the topic and word lists. This button is meant to be used after the user has updated the data using the form.

• Print Puzzle: Prints the puzzle.

• Pictures of arrows: Eight buttons for selecting the direction in which the program writes the word in the puzzle.

• Fill: Randomly fills the empty cells in the puzzle with uppercase letters.

In addition to the ActiveX controls, several areas of the worksheet are reserved for the puzzle, the puzzle title, the word list, and help messages. The puzzle grid is fifteen by fifteen cells and is formatted with borders and color. The range A1: Q1 is merged and formatted with a light colored font so that the title of the puzzle (topic) is centered in the middle of the puzzle. The fifteen cells in the eight rows immediately below the puzzle are merged into three cells per row. This gives a total of twenty-four cells for holding the list of words that have been added to a puzzle. Finally, an area of cells just to the right of the puzzle are merged and formatted in a large font to hold error and help messages output by the program. All of these areas were assigned defined names (Puzzle, Topic, WordList, and Output) to make the code that accesses these ranges easier to read.

Program execution is meant to proceed as follows:

1. The user populates the Combo Box and List Box controls with topics and words by clicking the Refresh button.

2. The user selects a topic from the Combo Box control and a new list of words is displayed in the List Box.

3. The user selects a word from the list in the List Box.

4. The user selects a cell in the puzzle grid.

5. The user clicks a button indicating the direction in which to write the word and the word is added to the puzzle.

6. The user continues to add words to the puzzle until he or she is satisfied with the puzzle.

7. The user clicks the Fill button and the program fills empty cells in the puzzle grid.

8. The user clicks the Print Puzzle button and the puzzle and word list is printed.

Biorhythm Awareness

Biorhythm Awareness

Who else wants to take advantage of biorhythm awareness to avoid premature death, escape life threatening diseases, eliminate most of your life altering mistakes and banish catastrophic events from your life.

Get My Free Ebook


Post a comment