UEU-co logo

Posts Tagged ‘VBA’

Functions I created a VBA function for use in worksheet formulas. However, it always returns #NAME?. What went wrong? You probably put the function in the code module for a Sheet (for example, Sheet1) or in the ThisWorkbook module. Custom worksheet functions must reside in standard VBA modules. I wrote a VBA function that works […]

Objects, Properties, Methods, and Events Is there a listing of the Excel objects I can use? Yes. The Help system has that information. I’m overwhelmed with all the properties and methods available. How can I find out which methods and properties are available for a particular object? There are several ways. You can use the […]

Modifying Chart Colors This section describes how to change colors in a chart. The most important point is to identify the specific chart element that you want to modify. In other words, you need to identify the object and then set the appropriate properties. Figure 30-14 shows a simple column chart named Chart 1. This […]

General Excel Questions How do I record a macro? Click the little square icon in the left side of the status bar. How do I run a macro? Choose View Macros Macros. Or, choose Developer Code Macros. What do I do if I don’t have a Developer tab? Display the Excel Options dialog box (Office […]

The Visual Basic Editor Can I use the VBA macro recorder to record all my macros? No. Recording is useful for very simple macros only. Macros that use variables, looping, or any other type of program flow changes cannot be recorded. You can, however, often take advantage of the macro recorder to write some parts […]

Procedures What’s the difference between a VBA procedure and a macro? Nothing, really. The term macro is a carry-over from the old days of spreadsheets. These terms are now used interchangeably. What’s a procedure? A procedure is a grouping of VBA instructions that can be called by name. If these instructions are to give an […]

Chapter 30: Working with Colors ¬†Download CD Content Overview In This Chapter One of the most significant changes in Excel 2007 is the abandonment of the old 56-color workbook palette. This chapter describes how color is used in Excel 2007, including the new themes. I include many examples that should help you understand how these […]

Specifying Colors In VBA, you can specify a color as a decimal color value, which is a number between 0 and 16,777,215. For example, the VBA statement that follows changes the background color of the active cell to a dark maroon: ActiveCell.Interior.Color = 5911168 In addition, VBA has some predefined constants for some common colors. […]

Chapter 29: Understanding Class Modules ¬†Download CD Content Overview In This Chapter This chapter presents an introduction to class modules and includes several examples that might help you better understand this feature and give you ideas for using class modules in your own projects. An introduction to class modules Some typical uses for class modules […]

What Is a Class Module? A class module is a special type of VBA module that you can insert into a VBA project. Basically, a class module enables the programmer (you) to create a new object class. As you should know by now, programming Excel really boils down to manipulating objects. A class module allows […]

Example: Creating a NumLock Class In this section, I provide step-by-step instructions for creating a useful, albeit simple, class module. This class module creates a NumLock class that has one property (Value) and one method (Toggle). Detecting or changing the state of the Num Lock key requires several Windows API functions, and the procedure varies […]

More about Class Modules The example in the preceding section demonstrates how to create a new object class with a single property named Value and a single method named Toggle. An object class can contain any number of properties, methods, and events. Naming the object class The name that you use for the class module […]

No related posts found…

Categories

apply_now Pepperstone Group Limited