380 Excel VBA Programming For Dummies, 2nd Edition line continuation character sequence, 4–5, 365 line numbers in code, 113 list, returning, 344–345 ListBox control, 256, 278–279, 296–301 listing shortcut menus, 321–322 loading add-ins, 351 Locals window (VBE), 207–208 Log function, 134 logic flaws in code, 197 logical operators, 111 Long data type, 99 lookup functions, 137–138 loop counters, 99 loops collections, 158–160 defined, 151–152 Do-Until loops, 142, 157–158 Do-While loops, 142, 156–157 For-Next loops, 142, 152, 154–156 ranges, 216–218 speed of, 146 LTrim function, 134 • M • macro recorder absolute mode, 84–85 efficiency, 90–92 Function procedures, 70 limitations of, 83–84 preparation for using, 25, 84 recording options, 88–89 relative mode, 85–86 step-by-step directions, 26–27, 82–83 Sub procedures, 70 VBA modules, 47–48 what gets recorded, 87–88 macros assigning to a button, 76–77 charts, 222–223 creating, 25–27 Ctrl+Shift+↓, 364–365 defined, 14 description, 26 descriptions, 88 disabling, 5–6 editing, 30 enabling, 5–6, BC19 errors, 22 events, 163 NameAndTime macro, 25–33 naming, 26, 88 Quick Access toolbar, 266 recording, 26–27, 30, 47–48, 81–92, 363 saving, 30–31 security, 31–32 shortcut keys, 26, 75–76, 88 storing, 26–27, 88 testing, 27, 267–268 UserForms, 265–268, 292–293 viewing, 27–29 Margin Indicator Bar option (VBE), 53 MAX worksheet function, 136 maximizing windows, 42–43 memory, 105 menu bar in Visual Basic Editor (VBE), 38 message boxes creating, 236–237 customizing, 238–241 displaying the value of two variables, 200–201 multiline messages, 365 responses, 237–238 methods Auto List Members, 66–67 Clear method, 128 collections, 64 Copy method, 127 defined, 20, 60–61, 63–64 Delete, 128 ExecuteMso, 250–251 GetOpenFilename, 244–248 GetSaveAsFilename, 248–249 Paste method, 127 Range object, 126 Range objects, 127–128 Select method, 126–127 specifying, 20 VBA Help System, 65 Microsoft Developer Network site (MSDN), 368 Microsoft Excel changing settings, 220–222 considering other options, BC19 Office Compatibility Pack, 22 versions, 20–22, 198, BC20 worksheet functions, 135–139
Index 381 Microsoft Excel 2010 Power Programming with VBA (Walkenbach), 2 Microsoft Excel Objects node, 40 Microsoft Product Support, 367–368 Mid function, 134 MIN worksheet function, 136 minimizing windows, 42–44 Minute function, 134 mixing and matching document theme elements, BC10 modifying add-ins, 359 chart type, 224 modular code, BC18 module-only variables, 103–104 modules. See VBA modules Modules node, 41 modulo arithmetic (mod) operator, 110 Month function, 134 mortgage payment, calculating, 137 moving controls (UserForms), 284 ranges, 215 MSDN (Microsoft Developer Network site), 368 MsgBox function, 132, 134, 200–201, 236–241 multidimensional arrays, 113 multiline messages, 365 MultiPage control, 257, 279 multiplication (*) operator, 110–111 MultiplyTwo custom function, 138–139 MultiSelect property, 299–300 • N • #NAME formula, 363 Name property, 272 NameAndTime macro creating, 25–27 description, 26 editing, 30 features, 25–33 naming, 26 recording, 26–27, 30 saving, 30–31 security, 31–32 shortcut key, 26 storing, 26–27 testing, 27 viewing, 27–29 naming controls (UserForms), 259–260, 272 Function procedures, 71 macros, 26, 88 Sub procedures, 71 variables, 97–98 newsgroups, 368 NewSheet event, 162 nodes (projects) defined, 40 Forms node, 41 Microsoft Excel Objects node, 40 Modules node, 41 non-Boolean settings, 221–222 noncontiguous ranges, 116–117 not operator, 111 Now function, 134 NumberFormat property (Range object), 126 • O • Object Browser, 66 Object data type, 99 Object Model Map, 57 object-oriented programming (OOP), 55 objects. See also objects by name active, 19 collections, 19, 58 colors, 125 defined, 18, 55–56 events, 64 exporting, 42 expressions, 109–110 hierarchy, 18–19, 56–57 identifying type of a selected object, 132 importing, 42 methods, 20, 60–61, 63–64 navigating through the hierarchy, 59 Object Browser, 66 Object Model Map, 57 properties, 19, 60–63 references, 19, 58–60, 229–230 VBA Help System, 65 Office Compatibility Pack, 22 Offset property, 118–119 On Error Resume Next statement, 192–193, 208
- Page 1 and 2:
Making Everything Easier! Microsof
- Page 3 and 4:
Excel ® VBA Programming FOR DUMmIE
- Page 5:
About the Author John Walkenbach is
- Page 8 and 9:
Publisher’s Acknowledgments We’
- Page 10 and 11:
Part VI: The Part of Tens .........
- Page 12 and 13:
x Excel VBA Programming For Dummies
- Page 14 and 15:
xii Excel VBA Programming For Dummi
- Page 16 and 17:
xiv Excel VBA Programming For Dummi
- Page 18 and 19:
xvi Excel VBA Programming For Dummi
- Page 20 and 21:
xviii Excel VBA Programming For Dum
- Page 22 and 23:
2 Excel VBA Programming For Dummies
- Page 24 and 25:
4 Excel VBA Programming For Dummies
- Page 26 and 27:
6 Excel VBA Programming For Dummies
- Page 28 and 29:
8 Excel VBA Programming For Dummies
- Page 30 and 31:
10 Excel VBA Programming For Dummie
- Page 32 and 33:
In this part . . . Every book must
- Page 34 and 35:
14 Part I: Introducing VBA A few wo
- Page 36 and 37:
16 Part I: Introducing VBA Creating
- Page 38 and 39:
18 Part I: Introducing VBA VBA in a
- Page 40 and 41:
20 Part I: Introducing VBA ✓ You
- Page 42 and 43:
22 Part I: Introducing VBA This boo
- Page 44 and 45:
24 Part I: Introducing VBA Figure 2
- Page 46 and 47:
26 Part I: Introducing VBA Recordin
- Page 48 and 49:
28 Part I: Introducing VBA Follow t
- Page 50 and 51:
30 Part I: Introducing VBA Earlier
- Page 52 and 53:
32 Part I: Introducing VBA Figure 2
- Page 54 and 55:
34 Part I: Introducing VBA
- Page 56 and 57:
In this part . . . The next four ch
- Page 58 and 59:
38 Part II: How VBA Works with Exce
- Page 60 and 61:
40 Part II: How VBA Works with Exce
- Page 62 and 63:
42 Part II: How VBA Works with Exce
- Page 64 and 65:
44 Part II: How VBA Works with Exce
- Page 66 and 67:
46 Part II: How VBA Works with Exce
- Page 68 and 69:
48 Part II: How VBA Works with Exce
- Page 70 and 71:
50 Part II: How VBA Works with Exce
- Page 72 and 73:
52 Part II: How VBA Works with Exce
- Page 74 and 75:
54 Part II: How VBA Works with Exce
- Page 76 and 77:
56 Part II: How VBA Works with Exce
- Page 78 and 79:
58 Part II: How VBA Works with Exce
- Page 80 and 81:
60 Part II: How VBA Works with Exce
- Page 82 and 83:
62 Part II: How VBA Works with Exce
- Page 84 and 85:
64 Part II: How VBA Works with Exce
- Page 86 and 87:
66 Part II: How VBA Works with Exce
- Page 88 and 89:
68 Part II: How VBA Works with Exce
- Page 90 and 91:
70 Part II: How VBA Works with Exce
- Page 92 and 93:
72 Part II: How VBA Works with Exce
- Page 94 and 95:
74 Part II: How VBA Works with Exce
- Page 96 and 97:
76 Part II: How VBA Works with Exce
- Page 98 and 99:
78 Part II: How VBA Works with Exce
- Page 100 and 101:
80 Part II: How VBA Works with Exce
- Page 102 and 103:
82 Part II: How VBA Works with Exce
- Page 104 and 105:
84 Part II: How VBA Works with Exce
- Page 106 and 107:
86 Part II: How VBA Works with Exce
- Page 108 and 109:
88 Part II: How VBA Works with Exce
- Page 110 and 111:
90 Part II: How VBA Works with Exce
- Page 112 and 113:
92 Part II: How VBA Works with Exce
- Page 114 and 115:
In this part . . . This is the part
- Page 116 and 117:
96 Part III: Programming Concepts S
- Page 118 and 119:
98 Part III: Programming Concepts V
- Page 120 and 121:
100 Part III: Programming Concepts
- Page 122 and 123:
102 Part III: Programming Concepts
- Page 124 and 125:
104 Part III: Programming Concepts
- Page 126 and 127:
106 Part III: Programming Concepts
- Page 128 and 129:
108 Part III: Programming Concepts
- Page 130 and 131:
110 Part III: Programming Concepts
- Page 132 and 133:
112 Part III: Programming Concepts
- Page 134 and 135:
114 Part III: Programming Concepts
- Page 136 and 137:
116 Part III: Programming Concepts
- Page 138 and 139:
118 Part III: Programming Concepts
- Page 140 and 141:
120 Part III: Programming Concepts
- Page 142 and 143:
122 Part III: Programming Concepts
- Page 144 and 145:
124 Part III: Programming Concepts
- Page 146 and 147:
126 Part III: Programming Concepts
- Page 148 and 149:
128 Part III: Programming Concepts
- Page 150 and 151:
130 Part III: Programming Concepts
- Page 152 and 153:
132 Part III: Programming Concepts
- Page 154 and 155:
134 Part III: Programming Concepts
- Page 156 and 157:
136 Part III: Programming Concepts
- Page 158 and 159:
138 Part III: Programming Concepts
- Page 160 and 161:
140 Part III: Programming Concepts
- Page 162 and 163:
142 Part III: Programming Concepts
- Page 164 and 165:
144 Part III: Programming Concepts
- Page 166 and 167:
146 Part III: Programming Concepts
- Page 168 and 169:
148 Part III: Programming Concepts
- Page 170 and 171:
150 Part III: Programming Concepts
- Page 172 and 173:
152 Part III: Programming Concepts
- Page 174 and 175:
154 Part III: Programming Concepts
- Page 176 and 177:
156 Part III: Programming Concepts
- Page 178 and 179:
158 Part III: Programming Concepts
- Page 180 and 181:
160 Part III: Programming Concepts
- Page 182 and 183:
162 Part III: Programming Concepts
- Page 184 and 185:
164 Part III: Programming Concepts
- Page 186 and 187:
166 Part III: Programming Concepts
- Page 188 and 189:
168 Part III: Programming Concepts
- Page 190 and 191:
170 Part III: Programming Concepts
- Page 192 and 193:
172 Part III: Programming Concepts
- Page 194 and 195:
174 Part III: Programming Concepts
- Page 196 and 197:
176 Part III: Programming Concepts
- Page 198 and 199:
178 Part III: Programming Concepts
- Page 200 and 201:
180 Part III: Programming Concepts
- Page 202 and 203:
182 Part III: Programming Concepts
- Page 204 and 205:
184 Part III: Programming Concepts
- Page 206 and 207:
186 Part III: Programming Concepts
- Page 208 and 209:
188 Part III: Programming Concepts
- Page 210 and 211:
190 Part III: Programming Concepts
- Page 212 and 213:
192 Part III: Programming Concepts
- Page 214 and 215:
194 Part III: Programming Concepts
- Page 216 and 217:
196 Part III: Programming Concepts
- Page 218 and 219:
198 Part III: Programming Concepts
- Page 220 and 221:
200 Part III: Programming Concepts
- Page 222 and 223:
202 Part III: Programming Concepts
- Page 224 and 225:
204 Part III: Programming Concepts
- Page 226 and 227:
206 Part III: Programming Concepts
- Page 228 and 229:
208 Part III: Programming Concepts
- Page 230 and 231:
210 Part III: Programming Concepts
- Page 232 and 233:
212 Part III: Programming Concepts
- Page 234 and 235:
214 Part III: Programming Concepts
- Page 236 and 237:
216 Part III: Programming Concepts
- Page 238 and 239:
218 Part III: Programming Concepts
- Page 240 and 241:
220 Part III: Programming Concepts
- Page 242 and 243:
222 Part III: Programming Concepts
- Page 244 and 245:
224 Part III: Programming Concepts
- Page 246 and 247:
226 Part III: Programming Concepts
- Page 248 and 249:
228 Part III: Programming Concepts
- Page 250 and 251:
230 Part III: Programming Concepts
- Page 252 and 253:
232 Part III: Programming Concepts
- Page 254 and 255:
In this part . . . The five chapter
- Page 256 and 257:
236 Part IV: Communicating with You
- Page 258 and 259:
238 Part IV: Communicating with You
- Page 260 and 261:
240 Part IV: Communicating with You
- Page 262 and 263:
242 Part IV: Communicating with You
- Page 264 and 265:
244 Part IV: Communicating with You
- Page 266 and 267:
246 Part IV: Communicating with You
- Page 268 and 269:
248 Part IV: Communicating with You
- Page 270 and 271:
250 Part IV: Communicating with You
- Page 272 and 273:
252 Part IV: Communicating with You
- Page 274 and 275:
254 Part IV: Communicating with You
- Page 276 and 277:
256 Part IV: Communicating with You
- Page 278 and 279:
258 Part IV: Communicating with You
- Page 280 and 281:
260 Part IV: Communicating with You
- Page 282 and 283:
262 Part IV: Communicating with You
- Page 284 and 285:
264 Part IV: Communicating with You
- Page 286 and 287:
266 Part IV: Communicating with You
- Page 288 and 289:
268 Part IV: Communicating with You
- Page 290 and 291:
270 Part IV: Communicating with You
- Page 292 and 293:
272 Part IV: Communicating with You
- Page 294 and 295:
274 Part IV: Communicating with You
- Page 296 and 297:
276 Part IV: Communicating with You
- Page 298 and 299:
278 Part IV: Communicating with You
- Page 300 and 301:
280 Part IV: Communicating with You
- Page 302 and 303:
282 Part IV: Communicating with You
- Page 304 and 305:
284 Part IV: Communicating with You
- Page 306 and 307:
286 Part IV: Communicating with You
- Page 308 and 309:
288 Part IV: Communicating with You
- Page 310 and 311:
290 Part IV: Communicating with You
- Page 312 and 313:
292 Part IV: Communicating with You
- Page 314 and 315:
294 Part IV: Communicating with You
- Page 316 and 317:
296 Part IV: Communicating with You
- Page 318 and 319:
298 Part IV: Communicating with You
- Page 320 and 321:
300 Part IV: Communicating with You
- Page 322 and 323:
302 Part IV: Communicating with You
- Page 324 and 325:
304 Part IV: Communicating with You
- Page 326 and 327:
306 Part IV: Communicating with You
- Page 328 and 329:
308 Part IV: Communicating with You
- Page 330 and 331:
310 Part IV: Communicating with You
- Page 332 and 333:
312 Part IV: Communicating with You
- Page 334 and 335:
314 Part IV: Communicating with You
- Page 336 and 337:
316 Part IV: Communicating with You
- Page 338 and 339:
318 Part IV: Communicating with You
- Page 340 and 341:
320 Part IV: Communicating with You
- Page 342 and 343:
322 Part IV: Communicating with You
- Page 344 and 345:
324 Part IV: Communicating with You
- Page 346 and 347:
326 Part IV: Communicating with You
- Page 348 and 349:
328 Part IV: Communicating with You
- Page 350 and 351: 330 Part IV: Communicating with You
- Page 352 and 353: In this part . . . The preceding 19
- Page 354 and 355: 334 Part V: Putting It All Together
- Page 356 and 357: 336 Part V: Putting It All Together
- Page 358 and 359: 338 Part V: Putting It All Together
- Page 360 and 361: 340 Part V: Putting It All Together
- Page 362 and 363: 342 Part V: Putting It All Together
- Page 364 and 365: 344 Part V: Putting It All Together
- Page 366 and 367: 346 Part V: Putting It All Together
- Page 368 and 369: 348 Part V: Putting It All Together
- Page 370 and 371: 350 Part V: Putting It All Together
- Page 372 and 373: 352 Part V: Putting It All Together
- Page 374 and 375: 354 Part V: Putting It All Together
- Page 376 and 377: 356 Part V: Putting It All Together
- Page 378 and 379: 358 Part V: Putting It All Together
- Page 380 and 381: 360 Part V: Putting It All Together
- Page 382 and 383: In this part . . . For reasons that
- Page 384 and 385: 364 Part VI: The Part of Tens How c
- Page 386 and 387: 366 Part VI: The Part of Tens
- Page 388 and 389: 368 Part VI: The Part of Tens And d
- Page 390 and 391: 370 Part VI: The Part of Tens Local
- Page 392 and 393: 372 Excel VBA Programming For Dummi
- Page 394 and 395: 374 Excel VBA Programming For Dummi
- Page 396 and 397: 376 Excel VBA Programming For Dummi
- Page 398 and 399: 378 Excel VBA Programming For Dummi
- Page 402 and 403: 382 Excel VBA Programming For Dummi
- Page 404 and 405: 384 Excel VBA Programming For Dummi
- Page 406 and 407: 386 Excel VBA Programming For Dummi
- Page 408 and 409: 388 Excel VBA Programming For Dummi
- Page 410 and 411: Internet Blogging For Dummies, 2nd
- Page 412 and 413: BC2 Excel VBA Programming For Dummi
- Page 414 and 415: BC4 Excel VBA Programming For Dummi
- Page 416 and 417: BC6 Excel VBA Programming For Dummi
- Page 418 and 419: BC8 Excel VBA Programming For Dummi
- Page 420 and 421: BC10 Excel VBA Programming For Dumm
- Page 422 and 423: BC12 Excel VBA Programming For Dumm
- Page 424 and 425: BC14 Excel VBA Programming For Dumm
- Page 426 and 427: BC16 Excel VBA Programming For Dumm
- Page 428 and 429: BC18 Excel VBA Programming For Dumm
- Page 430 and 431: BC20 Excel VBA Programming For Dumm
- Page 432: Computers/Spreadsheets Accelerate i