SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 185 | Next

Jim DeMarco

"Pro Excel 2007 VBA"

Access level information added
Figure 4-39. New employee data added to table
Summary
This chapter has explored UserForms in Excel 2007. UserForms allow developers to provide
a clean, easy-to-navigate data entry or retrieval experience to users. When users are entering
data into a large or unwieldy spreadsheet, we can provide a logical user experience by creating
applications with UserForms.
Form design is quick and easy using the controls provided in the UserForm Toolbox.
Although both of the samples in this chapter used only one UserForm each, you can place as
many as you need in your applications.
We used a somewhat nonstandard technique for adding functionality to our UserForms
by wrapping our code in custom objects in class modules.
The code behind our formis much cleaner than if we had coded directly behind the form.
How many module-level variables did we declare in our form??™s code-behind? Only four. How
many might we have used if we had coded our functionality right on the form? Certainly more
than four.
Even if using classes gave us nothing more than better-organized code, I??™d say it would be
worth the effort. And yes, it??™s a bit more effort than just dropping code in any standard module
and trying to manage it. But we actually get more than organization. By wrapping our functionality
in classes, we have the opportunity to give more thought to our code, and in some
cases develop classes we can use in other projects.
CHAPTER 4 n USERFORMS 191
Charting in Excel 2007
Excel 2007 provides us with an easy-to-use chart-creation tool that quickly lets us create and
modify or enhance the charts we build.


Pages:
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197