Muutke küpsiste eelistusi

Excel VBA Programming For Dummies 6th edition [Pehme köide]

  • Formaat: Paperback / softback, 432 pages, kõrgus x laius x paksus: 234x185x28 mm, kaal: 567 g
  • Ilmumisaeg: 04-Apr-2022
  • Kirjastus: For Dummies
  • ISBN-10: 1119843073
  • ISBN-13: 9781119843078
Teised raamatud teemal:
  • Pehme köide
  • Hind: 53,19 €*
  • * saadame teile pakkumise kasutatud raamatule, mille hind võib erineda kodulehel olevast hinnast
  • See raamat on trükist otsas, kuid me saadame teile pakkumise kasutatud raamatule.
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 432 pages, kõrgus x laius x paksus: 234x185x28 mm, kaal: 567 g
  • Ilmumisaeg: 04-Apr-2022
  • Kirjastus: For Dummies
  • ISBN-10: 1119843073
  • ISBN-13: 9781119843078
Teised raamatud teemal:
Find out what Excel is capable of with this step-by-step guide to VBA

Short of changing the tires on your car, Microsoft Excel can do pretty much anything. And the possibilities are even more endless when you learn to program with Excel Visual Basic for Applications (VBA). Regardless of your familiarity with Excel VBA, Excel VBA Programming For Dummies can enhance your experience with the popular spreadsheet software.

Pretty soon, you'll be doing things you didn't think were possible in Excel, from automating processes to writing your own worksheet functions. You'll learn how to:

  • Understand the basic tools and operations of Visual Basic for Applications
  • Create custom spreadsheet functions that make life easier for you and the people maintaining your spreadsheets
  • Deal with errors and exceptions and eliminate the bugs in your code

Perfect for anyone who's never even heard of Excel VBA, Excel VBA Programming For Dummies is also a fantastic resource for intermediate and advanced Excel users looking for a heads-up on the latest features and newest functionality of this simple yet powerful scripting language.

Introduction 1(6)
About This Book
1(4)
Typographical conventions
2(1)
Macro security
3(2)
Foolish Assumptions
5(1)
Icons Used in This Book
5(1)
Beyond the Book
6(1)
Where to Go from Here
6(1)
Part 1: Starting Excel VBA Programming 7(22)
Chapter 1 Getting to Know VBA
9(8)
Understanding VBA Basics
9(1)
Knowing What VBA Can Do
10(2)
Inserting a bunch of text
11(1)
Automating a task you perform frequently
11(1)
Automating repetitive operations
11(1)
Creating a custom command
11(1)
Creating a custom button
12(1)
Developing new worksheet functions
12(1)
Creating custom add-ins for Excel
12(1)
Getting the Most from VBA
12(2)
Knowing what VBA does best
12(1)
Recognizing the disadvantages of using VBA
13(1)
Understanding VBA Concepts
14(2)
Ensuring Excel Compatibility
16(1)
Chapter 2 Building Simple Macros
17(12)
Displaying the Developer Tab
17(1)
Creating a Macro
18(1)
Preparing the Environment
18(1)
Recording a Macro
19(2)
Running the Macro
21(1)
Viewing a Macro in the Visual Basic Editor
22(2)
Modifying the Macro
24(1)
Saving Workbooks That Contain Macros
25(1)
Understanding Macro Security
25(4)
Part 2: Employing VBA With Excel 29(68)
Chapter 3 Working in the Visual Basic Editor
31(20)
Getting to Know the Visual Basic Editor
31(3)
Activating the VBE
32(1)
Exploring VBE components
32(2)
Working with the Project Explorer
34(2)
Adding a new VBA module
35(1)
Working with a Code Pane
36(8)
Minimizing and maximizing windows
36(1)
Looking at the parts of a module
37(1)
Getting VBA code into a module
38(1)
Entering code directly
38(3)
Using the macro recorder
41(3)
Copying VBA code
44(1)
Customizing the VBE
44(7)
Using the Editor tab
44(3)
Using the Editor Format tab
47(1)
Using the General tab
48(1)
Using the Docking tab
48(3)
Chapter 4 Introducing the Excel Object Model
51(16)
Working with the Excel Object Model
51(6)
Understanding the object hierarchy
52(1)
Referring to objects
53(4)
Diving into Object Properties and Methods
57(5)
Setting object properties
58(2)
Taking action with object methods
60(1)
Triggering actions with object events
61(1)
Finding Out More from VBA Resources
62(5)
Using VBA's Help system
62(1)
Using the Object Browser
63(1)
Automatically listing properties and methods
64(3)
Chapter 5 VBA Sub and Function Procedures
67(16)
Understanding Subs versus Functions
67(2)
Looking at Sub procedures
68(1)
Looking at Function procedures
68(1)
Naming Subs and Functions
69(1)
Executing Sub procedures
70(8)
Executing the Sub procedure directly
72(1)
Executing the procedure from the Macro dialog box
73(1)
Executing a macro by using a shortcut key
74(1)
Executing the procedure from a button or shape
75(2)
Executing the procedure from another procedure
77(1)
Executing the procedure from the Immediate window
77(1)
Executing Function Procedures
78(5)
Calling the function from a Sub procedure
78(1)
Calling a function from the Immediate window
79(1)
Calling a function from a worksheet formula
80(3)
Chapter 6 Using the Excel Macro Recorder
83(14)
Recording Basics
84(1)
Preparing to Record
85(1)
Choosing Between Relative and Absolute Mode
86(5)
Recording in absolute mode
86(1)
Recording in relative mode
87(2)
Watching the Macro Recorder in Action
89(2)
Specifying Recording Options for Your Macro
91(1)
Streamlining Code Generated by the Macro Recorder
92(5)
Part 3: Programming Concepts 97(146)
Chapter 7 Essential VBA Language Elements
99(20)
Using Comments in Your VBA Code
99(2)
Using Variables, Constants, and Data Types
101(12)
Understanding variables
101(2)
What are VBA's data types?
103(1)
Declaring and scoping variables
103(7)
Working with constants
110(1)
Using premade constants
110(1)
Working with strings
111(1)
Working with dates
112(1)
Using Assignment Statements
113(3)
Assignment statement examples
113(1)
About that equal sign
114(1)
Smooth operators
114(2)
Working with Arrays
116(2)
Declaring arrays
116(1)
Multidimensional arrays
117(1)
Dynamic arrays
117(1)
Using Labels
118(1)
Chapter 8 Working with Range Objects
119(16)
Referring to Range Objects
119(2)
Referring to a Range Using Properties
121(3)
The Cells property
122(1)
The Offset property
122(1)
The Resize property
123(1)
Working with Range Object Properties
124(7)
The Value property
124(1)
The Text property
125(1)
The Count property
126(1)
The Column and Row properties
126(1)
The Address property
126(1)
The HasFormula property
127(1)
The Font property
128(1)
The Interior property
128(2)
The Formula property
130(1)
The NumberFormat property
131(1)
Taking Action with Range Object Methods
131(4)
The Select method
132(1)
The Copy and Paste methods
132(1)
The Clear method
133(1)
The Delete method
133(2)
Chapter 9 Using VBA and Worksheet Functions
135(16)
Understanding Functions
135(1)
Using Built-In VBA Functions
136(8)
Working with dates and times
136(2)
Manipulating strings
138(1)
Identifying objects and data
139(1)
VBA functions that do more than return a value
140(1)
Discovering VBA functions
141(3)
Using Worksheet Functions in VBA
144(4)
Worksheet function examples
144(3)
Entering worksheet functions
147(1)
More about using worksheet functions
148(1)
Using Custom Functions
148(3)
Chapter 10 Controlling Program Flow and Making Decisions
151(20)
Going with the Flow, Dude
151(1)
The GoTo Statement
152(2)
Decisions, Decisions
154(8)
The If-Then structure
154(4)
The Select Case structure
158(4)
Knocking Your Code for a Loop
162(6)
For-Next loops
162(5)
Do-While loop
167(1)
Do-Until loop
168(1)
Using For Each-Next Loops with Collections
168(3)
Chapter 11 Automatic Procedures and Events
171(22)
Preparing for the Big Event
171(3)
Learning when to use event procedures
173(1)
Programming event-handler procedures
174(1)
Knowing Where to Put the Event Code
174(1)
Writing an Event-Handler Procedure
175(2)
Triggering Workbook Events
177(4)
The Open event fora workbook
177(2)
The BeforeClose event for a workbook
179(1)
The BeforeSave event for a workbook
180(1)
Using Activation Events
181(4)
Activate and deactivate events in a sheet
181(1)
Activate and deactivate events in a workbook
182(2)
Workbook activation events
184(1)
Programming Worksheet-Related Events
185(3)
The BeforeDoubleClick event
185(1)
The BeforeRightClick event
185(1)
The Change event
186(2)
Understanding Events Not Associated with Objects
188(5)
The OnTime event
188(2)
Keypress events
190(3)
Chapter 12 Error-Handling Techniques
193(12)
Types of Errors
193(1)
An Erroneous Macro Example
194(4)
Not-quite-perfect macros
195(1)
Perfecting the macro
196(2)
Giving up on perfection
198(1)
Alternate Ways of Handling Errors
198(2)
Revisiting the EnterSquareRoot procedure
198(2)
Trapping errors with the On Error statement
200(1)
Handling Errors: The Details
200(3)
Resuming after an error
200(2)
Error handling in a nutshell
202(1)
An Intentional Error
203(2)
Chapter 13 Bug Extermination Techniques
205(14)
Species of Bugs
205(2)
Identifying Bugs
207(1)
Debugging Techniques
208(2)
Examining your code
208(1)
Using the MsgBox function
208(2)
Inserting Debug.Print statements
210(1)
Using the VBA debugger
210(7)
Using the Debugger's Tools
211(1)
Setting breakpoints in your code
211(3)
Using the Watches window
214(2)
Using the Locals window
216(1)
Bug Reduction Tips
217(2)
Chapter 14 VBA Programming Examples
219(24)
Working with Ranges
220(10)
Copying a range
220(1)
Copying a variable-size range
221(2)
Selecting to the end of a row or column
223(1)
Selecting a row or column
224(1)
Moving a range
224(1)
Looping through a range efficiently
225(2)
Looping through a range efficiently (Part II)
227(1)
Prompting for a cell value
227(1)
Determining the selection type
228(1)
Identifying a multiple selection
229(1)
Changing Excel Settings
230(1)
Changing Boolean settings
230(1)
Changing non-Boolean settings
231(1)
Working with Charts
231(6)
AddChart versus AddChart2
232(2)
Modifying the chart type
234(1)
Looping through the ChartObjects collection
234(1)
Modifying chart properties
235(1)
Applying chart formatting
235(2)
VBA Speed Tips
237(8)
Turning off screen updating
237(1)
Turning off automatic calculation
238(1)
Eliminating those pesky alert messages
239(1)
Simplifying object references
240(1)
Declaring variable types
241(1)
Using the With-End With structure
242(1)
Part 4: Communicating With Your Users 243(100)
Chapter 15 Simple Dialog Boxes
245(18)
Interacting with the User in VBA
246(1)
Displaying Messages with the MsgBox Function
247(5)
Displaying a simple message box
247(1)
Getting a response from a message box
248(2)
Customizing message boxes
250(2)
Getting Data with an Input Box
252(4)
Understanding the InputBox syntax
253(1)
Using the InputBox function
253(2)
Using the InputBox method
255(1)
Allowing the User to Select a File or Folder
256(4)
Constructing a GetOpenFilename statement
256(1)
Selecting a file with GetOpenFilename
256(3)
Picking a file with GetSaveAsFilename
259(1)
Getting a folder name
259(1)
Displaying Excel's Built-In Dialog Boxes
260(3)
Chapter 16 UserForm Basics
263(18)
Knowing When to Use a UserForm
263(2)
Creating UserForms: An Overview
265(1)
Working with UserForms
266(5)
Inserting a new UserForm
266(1)
Adding controls to a UserForm
267(1)
Changing properties for a UserForm control
268(1)
Viewing the UserForm Code pane
269(1)
Displaying a UserForm
269(1)
Using information from a UserForm
270(1)
A UserForm Example
271(10)
Creating the UserForm
271(1)
Adding the CommandButtons
272(1)
Adding the OptionButtons
272(3)
Adding event-handler procedures
275(2)
Creating a macro to display the dialog box
277(1)
Making the macro available
277(1)
Testing the macro
278(3)
Chapter 17 Using UserForm Controls
281(20)
Getting Started with Dialog Box Controls
281(4)
Adding controls
282(1)
Introducing control properties
283(2)
Learning Dialog Box Controls Details
285(11)
CheckBox control
285(1)
ComboBox control
286(1)
CommandButton control
287(1)
Frame control
288(1)
Image control
288(1)
Label control
289(1)
ListBox control
289(2)
MultiPage control
291(1)
OptionButton control
292(1)
RefEdit control
292(1)
ScrollBar control
293(1)
SpinButton control
294(1)
TabStrip control
295(1)
TextBox control
295(1)
ToggleButton control
296(1)
Working with Dialog Box Controls
296(4)
Moving and resizing controls
297(1)
Aligning and spacing controls
297(1)
Accommodating keyboard users
297(3)
Testing a UserForm
300(1)
Dialog Box Aesthetics
300(1)
Chapter 18 UserForm Techniques and Tricks
301(28)
Using Dialog Boxes
302(1)
A UserForm Example
302(7)
Creating the dialog box
302(3)
Writing code to display the dialog box
305(1)
Making the macro available
305(1)
Trying out your dialog box
306(1)
Adding event-handler procedures
307(2)
Validating the data
309(1)
Now the dialog box works
309(1)
A ListBox Control Example
309(5)
Filling a ListBox Control
310(2)
Determining the selected item
312(1)
Determining multiple selections
313(1)
Selecting a Range
314(2)
Using Multiple Sets of Option Buttons
316(1)
Using a Spin Button and a Text Box
317(2)
Using a UserForm as a Progress Indicator
319(4)
Creating the progress-indicator dialog box
320(1)
The procedures
321(1)
How this example works
322(1)
Creating a Modeless Tabbed Dialog Box
323(2)
Displaying a Chart in a UserForm
325(1)
A Dialog Box Checklist
326(3)
Chapter 19 Accessing Your Macros through the User Interface
329(14)
Customizing the Ribbon
329(8)
Customizing the Ribbon manually
330(2)
Adding a macro to the Ribbon
332(1)
Customizing the Ribbon with XML
333(4)
Customizing the Excel UI with VBA
337(8)
Adding commands to the Add-ins Ribbon tab
338(1)
Adding a new item to the Cell shortcut menu
339(1)
Adding customizations automatically
340(1)
Understanding shortcut menus and the single document interface
341(2)
Part 5: Putting It All Together 343(34)
Chapter 20 Creating Worksheet Functions
345(20)
Create Custom Functions to Simplify Your Work
345(2)
Understanding VBA Function Basics
347(1)
Writing Functions
347(1)
Working with Function Arguments
348(8)
A function with no argument
349(1)
A function with one argument
349(2)
A function with two arguments
351(1)
A function with a range argument
352(2)
A function with an optional argument
354(2)
Introducing Wrapper Functions
356(3)
The NumberFormat function
356(1)
The ExtractElement function
357(1)
The Saylt function
358(1)
The IsLike function
358(1)
Working with Functions That Return an Array
359(3)
Returning an array of month names
359(1)
Returning a sorted list
360(2)
Using the Insert Function Dialog Box
362(3)
Displaying the function's description
362(2)
Adding argument descriptions
364(1)
Chapter 21 Creating Excel Add-Ins
365(12)
Add-Ins Defined
365(1)
Reasons to Create Add-Ins
366(1)
Working with Add-Ins
367(1)
Understanding Add-In Basics
368(1)
Looking at an Add-In Example
369(10)
Setting up the workbook
369(3)
Testing the workbook
372(1)
Adding descriptive information
372(1)
Protecting the VBA code
373(1)
Creating the add-in
374(1)
Opening the add-in
374(1)
Distributing the add-in
375(1)
Modifying the add-in
375(2)
Part 6: The Part Of Tens 377(24)
Chapter 22 Ten Handy Visual Basic Editor Tips
379(10)
Applying Block Comments
380(1)
Copying Multiple Lines of Code at Once
381(1)
Jumping between Modules and Procedures
382(1)
Teleporting to Your Functions
382(1)
Staying in the Right Procedure
383(1)
Stepping through Your Code
383(1)
Stepping to a Specific Line in Your Code
384(1)
Stopping Your Code at a Predefined Point
385(1)
Seeing the Beginning and End of Variable Values
386(1)
Turning Off Auto Syntax Check
387(2)
Chapter 23 Resources for VBA Help
389(6)
Letting Excel Write Code for You
390(1)
Referencing the Help System
390(1)
Pilfering Code from the Internet
390(1)
Leveraging User Forums
391(1)
Visiting Expert Blogs
392(1)
Mining YouTube for Video Training
393(1)
Attending Live and Online Training Classes
393(1)
Learning from the Microsoft Office Dev Center
393(1)
Dissecting the Other Excel Files in Your Organization
394(1)
Asking Your Local Excel Guru
394(1)
Chapter 24 Ten VBA Do's and Don'ts
395(6)
Do Declare All Variables
395(1)
Don't Confuse Passwords with Security
396(1)
Do Clean Up Your Code
396(1)
Don't Put Everything in One Procedure
397(1)
Do Consider Other Software
397(1)
Don't Assume That Everyone Enables Macros
397(1)
Do Get in the Habit of Experimenting
398(1)
Don't Assume That Your Code Will Work with Other Excel Versions
398(1)
Do Keep Your Users in Mind
399(1)
Don't Forget about Backups
399(2)
Index 401
Dick Kusleika has over 25 years experience helping Office users get the most out of Microsofts bestselling software. From online forums to blogs, books, and conferences, he delivers sound and straightforward advice to readers of all skill levels.