(Business solutions) bill jelen, tracy syrstad VBA and macros for microsoft excel que pub (2004)

570 579 0
(Business solutions) bill jelen, tracy syrstad VBA and macros for microsoft excel que pub (2004)

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Bill Jelen, “Mr. Excel,” is an accomplished Excel author and the principal behind the leading Excel Web site, MrExcel.com. As an Excel consultant, he has written Excel VBA solutions for hundreds of clients around the Englishspeaking world. His Web site hosts more than 10 million page views annually. Prior to founding MrExcel.com, Jelen spent 12 years in the trenches—working as a financial analyst for finance, marketing, accounting, and operations departments of a 500 million public company. He lives near Akron, Ohio, with this wife Mary Ellen and sons Josh and Zeke.

C o n t e n t s a t a G l a n c e Introduction I First Steps up the VBA Learning Curve ?usinesssolutions VBA and Macros for  Microsoft Excel Unleash the Power of Excel with VBA! 11 This Sounds Like BASIC, So Why Doesn’t It Look Familiar? 29 Referring to Ranges 61 User-Defined Functions 75 Looping 103 R1C1 Style Formulas 117 Names 131 Event Programming 141 UserForms—An Introduction 161 II Automating Excel Power in VBA 10 11 12 13 14 15 16 Charts Data Mining with Advanced Filter Pivot Tables Excel Power Reading from and Writing to the Web XML in Excel 2003 Professional Automating Word III Techie Stuff You Will Need to Produce Applications for the Administrator to Run 17 Arrays 18 Text File Processing 19 Using Access as a Back End to Enhance Multi-User Access to Data 20 Creating Classes, Records, and Collections 21 Advanced UserForm Techniques 22 Windows Application Programming Interface (API) 23 Handling Errors 24 Using Custom Menus to Run Macros 25 Add-Ins 26 Case Study—Designing an Excel Application Bill Jelen, Mr Excel Tracy Syrstad 800 East 96th Street Indianapolis, Indiana 46240 175 207 235 291 331 349 359 379 387 401 415 433 453 467 481 497 505 Index 517 Associate Publisher VBA and Macros for Microsoft Excel Copyright  2004 by Sams Publishing All rights reserved No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher No patent liability is assumed with respect to the use of the information contained herein Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions Nor is any liability assumed for damages resulting from the use of the information contained herein International Standard Book Number: 0-7897-3129-0 Library of Congress Catalog Card Number: 2004102247 Printed in the United States of America First Printing: April 2004 06 05 04 03 Michael Stephens Acquisitions Editor Loretta Yates Development Editor Sean Dixon Managing Editor Charlotte Clapp Project Editor Andy Beaster Copy Editor Margo Catts Indexer Erika Millen Proofreader Kathy Bidwell Technical Editor Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized Sams Publishing cannot attest to the accuracy of this information Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark Warning and Disclaimer Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied The information provided is on an “as is” basis The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales For more information, please contact U.S Corporate and Government Sales 1-800-382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact International Sales 1-317-428-3341 international@pearsontechgroup.com Tom Urtis Publishing Coordinator Cindy Teeters Book Designer Anne Jones Page Layout Bronkella Publishing Kelly Maish Michelle Mitchell Contents Contents Introduction Getting Results with VBA What Is in This Book Getting Up the Learning Curve Excel VBA Power The Techie Stuff Needed to Produce Applications for Others Will This Book Teach Excel? A Brief History of Spreadsheets and Macros The Future of VBA and Excel Special Elements and Typographical Conventions Next Steps I FIRST STEPS UP THE VBA LEARNING CURVE Unleash the Power of Excel with VBA! 11 The Power of Excel 11 Barriers to Entry 11 The Macro Recorder Doesn’t Work! 11 Visual Basic Is Not Like BASIC 12 The Good News—It Is Easy to Climb the Learning Curve 12 The Great News—Excel with VBA Is Worth the Effort 12 Knowing Your Tools—The Visual Basic Toolbar 13 Macro Security 14 Very High Security 14 High Security 15 Medium Security 15 Low Security 15 Overview of Recording, Storing, and Running a Macro 15 Filling Out the Record Macro Dialog 15 Running a Macro 16 Creating a Macro Button 16 Assigning a Macro to a Form Control 17 Understanding the Visual Basic Editor (VBE) 18 VBE Settings 18 The Project Explorer 19 The Properties Window 20 iii iv VBA and Macros for Microsoft Excel Examining Code in the Programming Window 22 Running the Macro on Another Day Produces Undesired Results 24 A Possible Solution: Using Relative References when Recording 25 Frustration 28 Next Steps: Learning VBA Is the Solution 28 This Sounds Like BASIC, So Why Doesn’t It Look Familiar? 29 I Can’t Understand This Code 29 Understanding the Parts of VBA “Speech” 30 Is VBA Really This Hard? No! 33 VBA Help Files—Using F1 to Find Anything 33 Using Help Topics 35 Examining Recorded Macro Code—Using the VB Editor and Help 36 Optional Parameters 37 Defined Constants 37 Properties Can Return Objects 41 Using Debugging Tools to Figure Out Recorded Code 42 Stepping Through Code 42 More Debugging Options—Breakpoints 44 Backing Up or Moving Forward in Code 45 Not Stepping Through Each Line of Code 45 Querying Anything While Stepping Through Code 45 Using a Watch to Set a Breakpoint 50 Using a Watch on an Object 50 The Ultimate Reference to All Objects, Methods, Properties 51 Five Easy Tips for Cleaning Up Recorded Code 53 Tip 1: Don’t Select Anything 53 Tip 2: Ride the Range from the Bottom to Find Last Row 54 Tip 3: Use Variables to Avoid Hard-coding Rows and Formulas 55 Tip 4: Learn to Copy and Paste in a Single Statement 55 Tip 5: Use With End With If You Are Performing Multiple Actions to the Same Cell or Range of Cells 56 Putting It All Together—Fixing the Recorded Code 56 Next Steps 59 Contents Referring to Ranges 61 The Range Object 61 Using the Top-Left and Bottom-Right Corners of a Selection to Specify a Range 62 Shortcut for Referencing Ranges 62 Named Ranges 62 Referencing Ranges in Other Sheets 63 Referencing a Range Relative to Another Range 63 Using the Cells Property to Select a Range 64 Using the Cells Property in the Range Property 65 Using the Offset Property to Refer to a Range 65 Using the Resize Property to Change the Size of a Range 67 Using the Columns and Rows Properties to Specify a Range 68 Using the Union Method to Join Multiple Ranges 68 Using the Intersect Method to Create a New Range from Overlapping Ranges 69 Using the IsEmpty Function to Check Whether a Cell Is Empty 69 Using the CurrentRegion Property to Quickly Select a Data Range 70 Using the Areas Collection to Return a Non-contiguous Range 74 Next Steps 74 User-Defined Functions 75 Creating User-Defined Functions 75 Useful Custom Excel Functions 77 Set the Current Workbook’s Name in a Cell 77 Set the Current Workbook’s Name and File-Path in a Cell 77 Check Whether a Workbook Is Open 77 Check Whether a Sheet in an Open Workbook Exists 78 Count the Number of Workbooks in a Directory 79 Retrieve UserID 79 Retrieve Date and Time of Last Save 81 Retrieve Permanent Date and Time 81 Validate an Email Address 82 Sum Cells Based on the Interior Color 83 Retrieve Interior Cell Color Name or Index 84 Retrieve Text Color Index 87 Count Unique Values 88 Remove Duplicates from a Range 89 Find the First Non-Zero-Length Cell in a Range 91 Substitute Multiple Characters 92 Retrieve Numbers from Mixed Text 93 v vi VBA and Macros for Microsoft Excel Convert Week Number into Date 94 Separate Delimited String 94 Sort and Concatenate 95 Sort Numeric and Alpha Characters 97 Search for a String Within Text 98 Reverse the Contents of a Cell 99 Multiple Max 99 Return Hyperlink Address 100 Return the Column Letter of a Cell Address 101 Static Random 101 Using Select Case on a Worksheet 101 Next Steps 102 Looping 103 For Next Loops 103 Using Variables in the For Statement 106 Variations on the For Next Loop 106 Exiting a Loop Early After a Condition Is Met 107 Nesting One Loop Inside Another Loop 107 Do Loops 108 Using the While or Until Clause in Do Loops 111 While Wend Loops 113 The VBA Loop: For Each 113 Object Variables 113 Next Steps 116 R1C1 Style Formulas 117 Referring to Cells: A1 Versus R1C1 References 117 Why Care About R1C1 Style? 117 Not Just an Annoyance 117 Switching Excel to Display R1C1 Style References 118 The Miracle of Excel Formulas 119 Enter a Formula Once and Copy 1,000 Times 119 The Secret—It Is Not That Amazing 120 Explanation of R1C1 Reference Style 121 Using R1C1 with Relative References 121 Using R1C1 with Absolute References 122 Using R1C1 with Mixed References 123 Referring to Entire Columns or Rows with R1C1 Style 123 Replacing Many A1 Formulas with a Single R1C1 Formula 124 Remembering Column Numbers Associated with Column Letters 125 Contents Conditional Formatting—R1C1 Required 126 Setting Up Conditional Formatting in the User Interface 126 Setting Up Conditional Formats in VBA 127 Array Formulas Require Conditional Formatting 129 Next Steps 130 Names 131 Global Versus Local Names 131 Adding Names 132 Deleting Names 134 Types of Names 134 Formulas 134 Strings 135 Numbers 136 Using Arrays in Names 136 Reserved Names 137 Hiding Names 138 Checking for the Existence of a Name 138 Next Steps 140 Event Programming 141 Levels of Events 141 Using Events 141 Event Parameters 142 Enabling Events 142 Workbook Events 143 Workbook_Activate() 143 Workbook_Deactivate() 143 Workbook_Open() 143 Workbook_BeforeSave(ByVal SaveAsUI As Boolean, 144 144 Workbook_BeforeClose(Cancel As Boolean) 145 Workbook_NewSheet(ByVal Sh As Object) 146 Workbook_WindowResize(ByVal Wn As Window) 146 Workbook_WindowActivate(ByVal Wn As Window) 146 Workbook_WindowDeactivate(ByVal Wn As Window) 146 Workbook_AddInInstall() 147 Workbook_AddInUninstall 147 Workbook_SheetActivate(ByVal Sh As Object) 147 Cancel As Boolean) Workbook_BeforePrint(Cancel As Boolean) Workbook_SheetBeforeDoubleClick (ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) 147 Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) Workbook_SheetCalculate (ByVal Sh As Object) 147 147 vii viii VBA and Macros for Microsoft Excel 148 148 Workbook_SheetChange (ByVal Sh As Object, ByVal Target As Range) Workbook_SheetDeactivate (ByVal Sh As Object) Workbook_SheetFollowHyperlink (ByVal Sh As Object, ByVal Target As Hyperlink) 148 Workbook_SheetSelectionChange (ByVal Sh As Object, 148 Worksheet Events 148 Worksheet_Activate() 149 Worksheet_Deactivate() 149 ByVal Target As Range) Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 149 Worksheet_BeforeRightClick(ByVal Target As Range, 150 150 Worksheet_Change(ByVal Target As Range) 150 Worksheet_SelectionChange(ByVal Target As Range) 152 Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 152 Chart Sheet Events 152 Embedded Charts 153 Chart_Activate() 153 Cancel As Boolean) Worksheet_Calculate() Chart_BeforeDoubleClick(ByVal ElementID As Long, 154 154 Chart_Calculate() 154 Chart_Deactivate() 154 Chart_DragOver() 154 Chart_DragPlot() 154 ByVal Arg1 As Long, ByVal Arg2 As Long, Cancel As Boolean) Chart_BeforeRightClick(Cancel As Boolean) Chart_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long) 154 Chart_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long) 155 Chart_MouseUp(ByVal Button As Long, ByVal Shift As Long, 155 155 ByVal x As Long, ByVal y As Long) Chart_Resize() Chart_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long) 155 Chart_SeriesChange(ByVal SeriesIndex As Long, 156 Application-Level Events 156 AppEvent_NewWorkbook(ByVal Wb As Workbook) 157 AppEvent_SheetActivate(ByVal Sh As Object) 157 ByVal PointIndex As Long) AppEvent_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) 158 AppEvent_SheetBeforeRightClick(ByVal Sh As Object, 158 158 AppEvent_SheetChange(ByVal Sh As Object, ByVal Target As Range) 158 AppEvent_SheetDeactivate(ByVal Sh As Object) 158 ByVal Target As Range, Cancel As Boolean) AppEvent_SheetCalculate(ByVal Sh As Object) Contents AppEvent_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink) 158 AppEvent_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) 158 AppEvent_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window) 158 AppEvent_WindowDeactivate(ByVal Wb As Workbook, 159 159 AppEvent_WorkbookActivate(ByVal Wb As Workbook) 159 AppEvent_WorkbookAddinInstall(ByVal Wb As Workbook) 159 AppEvent_WorkbookAddinUninstall(ByVal Wb As Workbook) 159 ByVal Wn As Window) AppEvent_WindowResize(ByVal Wb As Workbook, ByVal Wn As Window) AppEvent_WorkbookBeforeClose(ByVal Wb As Workbook, Cancel As Boolean) 159 AppEvent_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean) 160 AppEvent_WorkbookBeforeSave(ByVal Wb As Workbook, ByVal SaveAsUI As Boolean, Cancel As Boolean) 160 AppEvent_WorkbookNewSheet(ByVal Wb As Workbook, 160 160 Next Steps 160 ByVal Sh As Object) AppEvent_WorkbookOpen(ByVal Wb As Workbook) UserForms—An Introduction 161 User Interaction Methods 161 InputBox 161 MsgBox 161 Creating a Userform 162 Calling and Hiding a Userform 163 Programming the UserForm 164 Using Basic Form Controls 165 Deciding Whether to Use ListBoxes or ComboBoxes in Your Forms 166 Adding Option Buttons to a UserForm 167 Adding Graphics to a UserForm 168 Using Spinbutton on a Userform 169 Using the Multipage Control to Combine Forms 170 Verifying Field Entry 170 Illegal Window Closing 171 Next Steps 172 II AUTOMATING EXCEL POWER IN VBA 10 Charts 175 Overview 175 Embedded Charts Versus ChartSheets 176 Embedded Charts in a ChartObject Container 176 Charts on a Chart Sheet Have No Container 178 ix NumUniqueValues() function multi-user access with Access, 401 ADO (ActiveX Data Objects), 402-404 case study, 403-404 DAO (Data Access Objects), 402 NameExists() function, 138 MyFullName() function, 77 names, 131 arrays, 136 cell color names, retrieving, 84-87 checking existence of, 138 computer names, returning, 455-456 creating, 132-133 deleting, 134 formulas, 134 global names, 131 hiding, 138 local names, 131 macros, 15 named ranges, 62-63 checking existence of, 138 creating, 132-133 deleting, 134 global names, 131 local names, 131 overwriting, 133 VLookups, 139-140 Names collection, 133 numbers, 136 overwriting, 133 reserved names, 137-138 strings, 135-136 workbook names, 77 MyName() function, 77 Names collection, 133 MySheets() function, 385 national debt, tracking, 340-341 multicolumn ListBoxes, 450 multidimensional arrays, 380 Multidimensional Database (MDB) files, 401 MultiFilter() function, 292-293 MultiPage control, 170-171 multiple characters, substituting, 92-93 multiple error handlers, 472 multiple pivot table fields, 258-260 Multiple Roots dialog box, 355 multiplication table, 124-125 MultiplicationTable function, 124 MultiSelect property (ListBox), 167 N named ranges, 62-63 checking existence of, 138 creating, 132-133 deleting, 134 global names, 131 local names, 131 overwriting, 133 VLookups, 139-140 NewDocument() function, 365 NewProc() function, 321-322 NewSheet() event, 146 NewWorkbook() event, 157 Next statement, 103-105 no matching records, handling, 224 nodupsArray() function, 90 non-contiguous cells, selecting/deselecting, 311-313 non-contiguous ranges, returning, 74 NoNames() function, 135 NOT statement, 112 Now function, 81 nesting For Next loops, 107-108 XML tags, 350 numbers adding, 76-77 column numbers, remembering, 125-126 names, 136 number of workbooks, counting, 79 pivot table number format, 247, 249 random numbers, creating, 101 retrieving from mixed text, 93 sorting, 97-98 week numbers, converting to dates, 94 NetTransfers() function, 410-411 NumFilesInCurDir() function, 79 New statement, 363 NumUniqueValues() function, 88 New Web Query dialog box, 332-333 How can we make this index more useful? Email us at indexes@quepublishing.com 533 534 Index Object Browser O OKButton_Click() function, 212, 221-222 Options command (Tools menu), 118 Object Browser, 51-52 Oliver, Nathan P., 293, 327 OR operator, 217-218 object variables, 113-114, 182-183 On Error GoTo syntax, 470-471 order lead time, measuring, 269-271 objects, 19, 30 See also ranges ADO (ActiveX Data Objects), 402-404 Axis, 189-191 ChartArea, 183-185 ChartTitle, 192-193 clsEmployee, 420 custom objects, 420-422 DAO (Data Access Objects), 402 DataLabel, 191-192 DataLabels, 191-192 Err, 472 ErrorBar, 193-195 FormatConditions, 127 Object Browser, 51-52 object variables, 113-114, 182-183 PlotArea, 186-188 positioning, 186-187 properties, 32-33, 41-42 Series, 188-189 sizing, 186-187 Trendlines, 193-195 Word objects bookmarks, 371-373 creating, 363-364 Document objects, 365-366 object model, 364-365 Range objects, 368-370 referencing, 363-364 Selection objects, 367 On Error Resume Next syntax, 472-473 out-of-range subscripts, 475-476 one-dimensional arrays, 380 outline view, 252-253 OnTime() function, 337 overlapping ranges, creating ranges from, 69 Offset property (Range object), 65-66 offsetting ranges, 65-66 open files, checking for, 456-457 open workbooks, checking for, 77-78 overwriting names, 133 P Open() event, 143 page fields, 276-279 Open() function, 366, 392 page setup, 313-315 problems with, 473 opening text files delimited files, 392-394 files with less than 65,536 rows, 387 files with less than 98,304 rows, 394-397 files with more than 98,304 rows, 397-398 fixed-width files, 388-391 one row at a time, 395-397 Word documents, 366 OpenLargeCSVFast() function, 297-298 OpenSchema() function, 411 OpenText() function, 36, 387, 394 operators, 217-218 Option Base statement, 379 option buttons, 167-168 optional parameters, 37 parameters events, 142 methods, 32-33, 37 parsing CSV files, 298-299 PassAnArray() function, 386 passing arrays, 386 PasswordBox() function, 322 passwords checking, 477-478 protected password box, 320-322 paste operations, disabling, 316-318, 328-329 percentages percentage growth from previous month, 286-287 reporting in pivot tables, 286-288 permanent date/time, retrieving, 81 Personal Macro Workbook, 16 Property Get procedure Perspective property (charts), 198 Picture Catalog userform, 444-446 pie charts, 196, 199-201, 204 pipe character (|), 336 pivot table reports, creating, 250 automatic subtotals, 254 blank report worksheets, moving data to, 251 executive overviews, 271-274 formatting, 253 outline view, 252-253 Product Line Manager sample report, 255-257 region/product reports, 276-279 Report workbooks, 250-251 Pivot Table Wizard, 236-238 pivot tables, 235 averages, 284-285 blank cells, deleting, 245-246 calculated data fields, 260-264 creating with Pivot Table Wizard, 236-238 creating with VBA, 238-240 limitations, 241 sums of revenues, 240-241 table size, 241-243 default pivot tables, 243-245 Excel 97, 288-289 executive overviews, 271-274 grand totals, suppressing, 250 grouping data, 264-267 grouping by week, 267-268 order lead time, measuring, 269-271 minimums/maximums, 284-285 multiple data fields, 258-260 number format, 247, 249 page fields, 276-283 percentages, 286-288 PivotFields, filtering, 280-283 recordsets, filtering, 274-276 reports automatic subtotals, 254 blank report worksheets, moving data to, 251 executive overviews, 271-274 formatting, 253 outline view, 252-253 Product Line Manager sample report, 255-257 region/product reports, 276-279 Report workbooks, 250-251 ShowDetail feature, 274-276 sort order, 246-247 subtotals, 249, 254 sums, 284-285 Top 10 AutoShow feature, 271-274 versions, 235 PivotExcel97Compatible() function, 288-289 PivotTable Field dialog box, 246 PlaceGraph() function, 307 playing sounds, 462 PlaySound() function, 462 PlayWavSound API function, 462 plot area, 186-188 PlotArDemo() function, 187 PlotArea object, 186-188 positioning objects, 186-187 previously scheduled macros, canceling, 338-339 Print Area reserved name, 138 Print Titles reserved name, 138 printing page setup, 313-315 Word documents, 366 PrintOut, 366 private API functions, 454 ProduceReportOfTwoProdu cts() function, 281-283 Product Line Manager sample report, 255-257 ProductLineManagerReport () function, 255-257 ProgIds, 442-443 Programming window, 22-24 progress indicator, 319-320 Project Explorer, 19 Project Explorer command (View menu), 19 projects, locking, 477-478 Properties window (VBE), 20 Property Get procedure, 422-423 How can we make this index more useful? Email us at indexes@quepublishing.com 535 536 Index Property Let procedure Property Let procedure, 422-423 QueryClose() function, 171, 450 protected password box, 320-322 QueryPerformanceFrequency() function, 315 protecting code, 477-478 QuickFillAverage() function, 383 protocols, FTP (File Transfer Protocol), 347 QuickFillMax() function, 382 public API functions, 454 QuickSort() function, 97 publishing to Web, 341-342 content management systems, 344-347 custom Web pages, 343 Save as Web Page command, 341 QuizColumnNumbers() function, 125 pyramid charts, 197 Q queries Amazon.com query results, 354 multiple pages of results, 356-357 sample query, 355-356 hovering, 48 querying while stepping through code, 45 watches, 48-50 Web queries, 331 creating manually, 332 creating with VBA, 334-336 refreshing, 332 updating, 333 QuerybyAuthor() function, 355-356 QuerybyPublisher() function, 356-357 R R1C1 references absolute references, 122-123 advantages of, 117-120 case study, 121 column numbers, remembering, 125-126 conditional formatting array formulas, 129 case study, 128-129 setting up in user interface, 126-127 setting up in VBA, 127 displaying, 118-119 entire columns/rows, referencing, 123 mixed references, 123 multiplication table example, 124-125 relative references, 121-122 R1C1Style() function, 121 radar charts, 196 random numbers, creating, 101 Range() function, 62 ranges, 61, 368 Advanced Filter, 215-218 cells empty cells, checking for, 69-70 first non-zero-length cell, finding, 91 selecting, 71-73 creating from overlapping ranges, 69 defining, 368-369 duplicates, removing, 89-90 formatting, 369-370 joining, 68-69 maximum values, returning, 99-100 named ranges, 62-63 checking existence of, 138 creating, 132-133 deleting, 134 global names, 131 local names, 131 overwriting, 133 VLookups, 139-140 non-contiguous ranges, 74 offsetting, 65-66 properties Cells, 64-65 Columns, 68 CurrentRegion, 70-71 Offset, 65-66 Resize, 67 Rows, 68 referencing in other worksheets, 63 relative to other ranges, 63-64 with Offset property, 65-66 reports resizing, 67 selecting with Cells property, 64-65 with CurrentRegion property, 70-71 shortcuts, 62 specifying with Columns and Rows properties, 68 with top-left and bottom-right corners, 62 Word ranges, 368-370 RangeText() function, 368 reading Access databases, 404 CSV files, 298-299 text files delimited files, 392-394 files with less than 65,536 rows, 387 files with less than 98,304 rows, 394-397 files with more than 98,304 rows, 397-398 fixed-width files, 388-391 one row at a time, 395-397 ReadLargeFile() function, 397-398 ReadTxtLines() function, 298-299 Ready mode, 337-338 Record Macro button (Visual Basic toolbar), 13 Record Macro dialog box, 15-16 recording macros, 22 absolute references, 25-27 preparation, 21 Record Macro dialog box, 15-16 relative references, 25-27 records above-average records, returning, 224 adding, 404 deleting, 404, 410 inserting, 404-406 no matching records, handling, 224 retrieving, 406-407 summarizing, 410-411 updating, 408-409 recordsets, filtering with pivot tables, 274-276 RefEdit control, 438 references A1 references, 117 custom objects, 421-422 R1C1 references absolute references, 122-123 advantages of, 117-120 case study, 121 column numbers, remembering, 125-126 conditional formatting, 126-129 displaying, 118-119 entire columns/rows, referencing, 123 mixed references, 123 multiplication table example, 124-125 relative references, 121-122 ranges in other worksheets, 63 Offset property, 65-66 relative to other ranges, 63-64 shortcuts, 62 relative references, 25-27 Word objects, 363-364 References command (Tools menu), 360 RefreshAllWebQueries() function, 333 refreshing Web queries, 332 relative references, 25-27, 121-122 removing See deleting Report workbooks, 250-251 ReportByMonth() function, 266-267 ReportByWeek() function, 267-268 ReportManyDetailsByCusto mer() function, 284-285 reports pivot table reports automatic subtotals, 254 blank report worksheets, moving data to, 251 executive overviews, 271-274 formatting, 253 outline view, 252-253 Product Line Manager sample report, 255-257 region/product reports, 276-279 Report workbooks, 250-251 Record New Macro command (Macro menu), 15 How can we make this index more useful? Email us at indexes@quepublishing.com 537 538 Index reports Product Line Manager sample report, 255-257 Word, 373-376 Require Variable Declaration setting (VBE), 18 reserved names, 137-138 Reset button, 467 Reset command (Run menu), 43 ReSet() function, 309 resetFormatting() function, 513 resetValue() function, 515 Resize property (Range object), 67 Resize() event, 155 resizing comments, 304-306 ranges, 67 UserForms, 163, 441-442 Rotation property (charts), 198 round-tripping, 353-354 rows deleting with conditions, 325-326 entire columns/rows, referencing, 123 rows with largest values, identifying, 128-129 Rows property (Range object), 68 S Save as Web Page command (File menu), 341 Run Sub command (Run menu), 44 SaveChart() function, 202 running See also scheduling macros code to cursor, 45 macros, 16 ActiveX controls, 494 command buttons, 492-494 custom menus, 481-486 custom toolbars, 487-491 hyperlinks, 495-496 keyboard shortcuts, 491 timer, 460 RotateFirstSlice() function, 200 RunTimer() function, 460 Run menu commands Reset, 43 Run Sub, 44 RetrieveTop3CustomerDetail() function, 275-276 RightAngleAxes property (charts), 198 Runtime Error 1004, 476-477 Save As command (File menu), 499 RunCustReport() function, 228-229 reversing cell contents, 99 Runtime Error 9, 475-476 Run Macro button (Visual Basic toolbar), 13 RetrieveNumbers() function, 93 ReverseContents() function, 99 runtime, adding controls at, 440-443 Sandbox, 14 resolution, 457-458 RevenueByCustomers() function, 211 RunReportForEachCustomer() function, 231-233, 374-376 RowSource property (ListBox), 166 Run to Cursor command (Debug menu), 45 ReturnMaxs() function, 99-100 running totals, 287-288 SaveAs() function, 366 scatter charts, 196, 203 ScheduleAnything() function, 339 ScheduleTheDay() function, 337 scheduling macros canceling previously scheduled macros, 338-339 CaptureData() function, 337 DebtClock case study, 340-341 OnTime() function, 337 Ready mode, 337-338 running every two minutes, 339-340 running x minutes in the future, 339 specifying ranges ScheduleTheDay() function, 337 windows of time for updates, 338 Schemas (XML), 351-352 ScrollBar1_Change() function, 446 Send to Back command (UserForm toolbar), 433 shortcut keys, assigning, 16, 491 separating delimited strings, 94-95 worksheets into workbooks, 299-300 Show() function, 470 ShowCustForm() function, 213 Series object, 188-189 ShowDetail feature (pivot tables), 274-276 signatures, digital, 15, 19 secondary axes, 190-191 SeriesChange() event, 156, 202 SecondaryAxisDemo() function, 191 SeriesCollection collection, 188 security add-ins, 502 digital signatures, 19 macros, 14-15 SeriesDemo() function, 189 scrollbars, 446-447 Security command (Macro menu), 14 Select() event, 155 Select Case statement, 101-102 SelectAll() function, 434 SetReportInItalics() function, 476-477 SetSourceData() function, 179 Sills, Richie, 292 sizing comments, 304-306 objects, 186-187 pivot tables, 241-243 ranges, 67 UserForms, 163, 441-442 SlowAverage() function, 383 SetTimer API function, 460 SortConcat() function, 95-96 SetValuestoTabStrip() function, 437 sorter function, 97-98 SheetActivate() event, 147, 157 selecting cells non-contiguous cells, 311-313 SpecialCells() function, 71-73, 324-325 ranges Cells property, 64-65 CurrentRegion property, 70-71 non-contiguous ranges, 74 SheetBeforeDoubleClick() event, 147 Selection objects (Word), 367 SheetFollowHyperlink() event, 148, 158 SelectionChange() event, 152 SheetSelectionChange() event, 148, 158 SelectSentence() function, 369 ShellExecute API function, 439, 461 SheetBeforeRightClick() event, 147, 158 SheetCalculate() event, 147, 158 sorting data BubbleSort function, 96 QuickSort function, 97 sort order AutoSort, 246-247 controlling manually, 247 customizing, 318-319 SortConcat function, 95-96 sorter function, 97-98 SheetChange() event, 148, 158 sounds, playing, 462 SheetDeactivate() event, 148, 158 SpecialRange() function, 325 SheetExists() function, 78-79 SpecialCells function, 71-73 specific items, percentage of, 287 specifying ranges with Columns and Rows properties, 68 with top-left and bottomright corners, 62 How can we make this index more useful? Email us at indexes@quepublishing.com 539 540 Index speedometer chart speedometer chart, 204 SpinButtons, 169-170 stepping through code, 42-45 SplitWorkbook() function, 299-300 stock information, retrieving, 327-328 standard modules, creating collections in, 424-425 stock quote charts, 197 StartTimer() function, 460 statements Do, 108-111 Exit For, 107 For, 103-105 loops directory files, looping through, 115-116 Do Loop, 108-111 Do Until, 111-112 Do While, 111-112 For Each, 113-114 For Next, 103-108 While Wend, 113 New, 363 Next, 103-105 NOT, 112 Option Base, 379 Property Get, 422-423 Property Let, 422-423 Select Case, 101-102 Step, 106-107 To, 104 Type End Type, 429 Until, 111-112 Wend, 113 While, 111-112 With End With, 56 WithEvents, 416 Stop Recording command (Macro menu), 22 Stop Recording toolbar, 14, 22 T tab order, 448 TableExists() function, 411-412 tables See pivot tables TabOrientation property (Tabstrip), 437 stopping macro recorder, 22 TabStrip1_Change() function, 437 StopTimer() function, 460 Tabstrips, 436-438 streaming data, 336-337 tags (XML), 436, 350 StringElement() function, 94-95 Test() function, 315-316 strings delimited strings, 94-95 finding within text, 98 names, 135-136 Sub Srch() function, 293-295 subscripts out of range, 475-476 substituting multiple characters, 92-93 subtotals adding, 254 automatic subtotals, 254 suppressing, 249 Subtotals() function, 249 SumColor() function, 83-84 summarizing records, 410-411 state_period() function, 102 sums (pivot tables), 240-241, 284-285 StaticRAND() function, 101 supply curve chart, 205 Step clause, 106-107 suppressing totals, 249-250 Step Into command (Debug menu), 42 surface charts, 197 SwapElements() function, 98 text files case, changing, 322-323 color index, 87-88 control tip text, 448 finding strings in, 98 importing, 297-298 delimited files, 392-394 files with less than 65,536 rows, 387 files with less than 98,304 rows, 394-397 files with more than 98,304 rows, 397-398 fixed-width files, 388-391 one row at a time, 395-397 reading and parsing, 298-299 retrieving numbers from, 93 Text Import Wizard, 38-39 writing, 398-399 Text Import Wizard, 21, 38-39 delimited files, 392-394 files with less than 98,304 rows, 394-397 UDFs files with more than 98,304 rows, 397-398 fixed-width files, 388-391 TextCaseChange() function, 322-323 References, 360 VBAProject Properties, 502 Top 10 AutoShow feature (pivot tables), 271-274 TrimNull() function, 465 troubleshooting missing Word objects, 361 turning off alerts, 473-474 Textcolor() function, 87-88 Top10ByRegionReport() function, 277-279 Type property (SpecialCells function), 72 TextToColumns() function, 396 Top6CEOReport() function, 272-274 Type End Type statement, 429 time to execute code, calculating, 315-316 types ExcelCoords, 509 UDTs (user-defined types), 429-432 To clause, 104 totals (pivot tables) grand totals, 250 percentage of, 286 running totals, 287-288 subtotals adding, 254 automatic subtotals, 254 suppressing, 249 toggle buttons, 436 TotColumns() function, 254 toolbars Control Toolbox, 494 custom toolbars buttons, 488-489 creating, 487-488 deleting, 487-488 drop-downs, 489-490 icons, 489 remembering position of, 490-491 forms, 17 macro buttons, assigning macros to, 16-17 Stop Recording, 14, 22 UserForm toolbar, 433 Visual Basic, 13-14 tracking national debt, 340-341 UDFs (user-defined functions), 75 Add, 76-77 BookOpen, 77-78 CellColor, 84-87 ColName, 101 ContainsText, 98 DateTime, 81 FirstNonZeroLength, 91 GetAddress, 100 IsEmailValid, 82-83 LastSaved, 81 MSubstitute, 92-93 MyFullName, 77 MyName, 77 NumFilesInCurDir, 79 NumUniqueValues, 88 RetrieveNumbers, 93 ReturnMaxs, 99-100 ReverseContents, 99 SheetExists, 78-79 SortConcat, 95-96 sorter, 97-98 state_period, 102 StaticRAND, 101 StringElement, 94-95 time/date of last save, retrieving, 81 timers, 460 titles, 192-193 TrailingMinusNumbers parameter, 478 Transforms (XSL), 352 transparent forms, 451-452 TransposeArray() function, 384 TransposeData() function, 310-311 transposing data, 310-311, 384 TrapAppEvent() function, 417 Toolbars command (View menu), 13 TrapChartEvent() function, 419 Toolbars menu commands, Visual Basic, 13 trapping events application events, 416-418 embedded chart events, 418-419 Tools menu commands Add-Ins, 500 Macro, 14 Options, 118 trendlines, 193-195 Trendlines object, 193-195 TypeText() function, 367 U How can we make this index more useful? Email us at indexes@quepublishing.com 541 542 Index UDFs SumColor, 83-84 Textcolor, 87-88 UniqueValues, 89-90 Weekday, 94 WinUserName, 79-81 UDTs (user-defined types), 429-432 Ungroup command (UserForm toolbar), 433 Uniform Size command (UserForm toolbar), 433 Union function, 68-69 unique list of values, extracting Advanced Filter dialog box, 208 AdvancedFilter function, 209 CancelButton_Click() function, 212 cbSubAll_Click() function, 212 cbSubClear_Click() function, 212 GetUniqueCustomers() function, 210 multiple field values, 214-215 OKButton_Click() function, 212 RevenueByCustomers() function, 211 ShowCustForm() function, 213 single column list ranges, 208-209 UniqueCustomerRedux() function, 210 UserForm_Initialize() function, 213 Unique Records Only feature (Advanced Filter), 226 unique values, counting, 88 UniqueCustomerProduct() function, 214-215 UniqueCustomerRedux() function, 210 UserForm_Initialize() function, 213, 222-223, 408, 435-437, 444-446, 459 userIDs, 80-81 UserName() function, 454-455 V UniqueProductsOneCustom er() function, 216 validation, 82-83, 132 UniqueValues() function, 89-90 Value property (SpecialCells function), 72 Unload() function, 163 variables advantages of, 55 arrays advantages of, 383-384 declaring, 379-380 defined, 379 dynamic arrays, 385 emptying, 382-383 filling, 380-382 multidimensional arrays, 380 one-dimensional arrays, 380 passing, 386 transposing, 384 For statements, 106 object variables, 113-114, 182-183 unloading UserForms, 163 UnselectAll() function, 434 Until clause, 111-112 Update() function, 405 updating records, 408-409 Web queries, 333 Urtis, Tom, 295, 305-306, 311, 319, 326 UseBookmarks() function, 372 UseGetObject() function, 363 user interaction functions, 161-162 user-defined functions See UDFs user-defined types See UDTs UserForm command (Insert menu), 162 UserForm toolbar, 433 UserForms See forms UserForm_Activate() function, 449 VBA (Visual Basic for Applications), 29-30 See also forms advantages of, 12-13 arrays advantages of, 383-384 array formulas, 129 declaring, 379-380 defined, 379 dynamic arrays, 385 emptying, 382-383 VBA filling, 380-382 multidimensional arrays, 380 names, 136 one-dimensional arrays, 380 passing, 386 transposing, 384 collections, 33 compared to BASIC, 12, 29-30 conditional formatting array formulas, 129 case study, 128-129 setting up in user interface, 126-127 setting up in VBA, 127 constants, 37-41 debugging techniques backing up/moving forward in code, 45 breakpoints, 44-45, 50 hovering, 48 Immediate window, 45-48 running to cursor, 45 stepping through code, 42-45 watches, 48-50 error handling alerts, turning off, 473-474 client training, 474-475 code protection, 477-478 Continue, End, Debug, Help error message, 467 Debug button, 467-470 encountering errors on purpose, 474 Err object, 472 File not loaded completely, 394 ignoring errors, 472-473 multiple error handlers, 472 On Error GoTo, 470471 On Error Resume Next, 472-473 page setup problems, 473 password checking, 477-478 Runtime Error 9, 475-476 Runtime Error 1004, 476-477 version problems, 478-479 events See also names of individual events accessing from VBA Object and Procedure drop-down, 141-142 enabling, 142 parameters, 142 trapping, 416-419 formula-based conditions, 220-224 help, 33-35 loops directory files, looping through, 115-116 Do Loop, 108, 110-111 Do Until, 111-112 Do While, 111-112 For Each, 113-114 For Next, 103-108 While Wend, 113 methods, 30-33, 37 names arrays, 136 checking existence of, 138 creating, 132-133 deleting, 134 formulas, 134 global names, 131 hiding, 138 local names, 131 named ranges for VLookups, 139-140 Names collection, 133 numbers, 136 overwriting, 133 reserved names, 137-138 strings, 135-136 object properties, 30-33, 41-42 pivot tables, creating, 238-240 limitations, 241 sums of revenues, 240-241 table size, 241-243 ranges, 61 cells, selecting, 71-73 creating from overlapping ranges, 69 empty cells, checking for, 69-70 joining, 68-69 named ranges, 62-63 non-contiguous ranges, 74 offsetting, 65-66 referencing in other worksheets, 63 referencing relative to other ranges, 63-64 How can we make this index more useful? Email us at indexes@quepublishing.com 543 544 Index VBA referencing with Offset property, 65-66 resizing, 67 selecting with Cells property, 64-65 selecting with CurrentRegion property, 70-71 shortcuts, 62 specifying with Columns and Rows properties, 68 specifying with top-left and bottom-right corners, 62 recorded macro code, examining, 36-37 constants, 37-41 optional parameters, 37 properties, 41-42 statements Do, 108-111 Exit For, 107 For, 103-105 Next, 103-105 Step, 106-107 To, 104 Until, 111-112 Wend, 113 While, 111-112 With End With, 56 syntax, 30-33 variables, 55, 113-114 VBE (Visual Basic Editor) add-ins, converting files to, 499-500 debugging techniques, 44-50 digital signatures, enabling, 19 Object Browser, 51-52 options, 18 Programming window, 22-24 Project Explorer, 19 Properties window, 20 recorded macro code, examining, 36-42 Visual Basic toolbar, 13-14 Web queries, 331-336 verifying form field entries, 170 Very High security (macros), 14 VideoRes() function, 457 View menu commands Project Explorer, 19 Toolbars, 13 VBA Object and Procedure drop-down menu, 141-142 Visible property (names), 138 VBAProject Properties command (Tools menu), 502 Visual Basic command (Toolbars menu), 13 VBE (Visual Basic Editor) add-ins, converting files to, 499-500 debugging techniques backing up/moving forward in code, 45 breakpoints, 44-45, 50 hovering, 48 Immediate window, 45-48 running to cursor, 45 stepping through code, 42-45 watches, 48-50 digital signatures, enabling, 19 Object Browser, 51-52 options, 18 Programming window, 22-24 Project Explorer, 19 Properties window, 20 recorded macro code, examining, 36-37 constants, 37-41 optional parameters, 37 properties, 41-42 Visual Basic Editor button (Visual Basic toolbar), 13 Visual Basic Editor See VBE Visual Basic for Applications See VBA Visual Basic toolbar, 13-14 VLOOKUP function, 139-140 W Wallentin, Dennis, 301-302, 325 warnings See alerts watches, 48-50 WCL_FTP, 347 Web See also Web sites FTP (File Transfer Protocol), 347 publishing data to, 341-342 content management systems, 344-347 custom Web pages, 343 Save as Web Page command, 341 Word automation scheduled macros canceling, 338-339 CaptureData function, 337 DebtClock case study, 340-341 OnTime function, 337 Ready mode, 337-338 running every two minutes, 339-340 running x minutes in the future, 339 ScheduleTheDay function, 337 windows of time for updates, 338 streaming data, 336-337 Web queries, 331 creating manually, 332 creating with VBA, 334-336 refreshing, 332 updating, 333 Web queries, 331 creating manually, 332 creating with VBA, 334-336 refreshing, 332 updating, 333 Web sites Amazon Development Kit, 354-355 Colo’s Junkroom, 297 Excel Tips and Tricks, 301 Klann, Daniel, 320 Mehta, Tushar, 505 WCL_FTP, 347 XcelFiles, 308 weeks grouping by, 267-268 week numbers, converting to dates, 94 Weekday() function, 94 Wend statement, 113 While clause, 111-112 While Wend loops, 113 Window menu commands, Hide, 503 online resources, 466 open files, checking for, 456-457 sounds, playing, 462 timer, running, 460 X button, disabling, 458-459 WindowActivate() event, 146, 158 WinUserName() function, 79-81 WindowDeactivate() event, 146, 159 WinWord.exe, 363 WindowResize() event, 146, 159 Windows API clickable links, 461 computer names, returning, 455-456 display resolution, 457-458 file paths, 462-465 functions apiGetOpenFileName, 462 apiGetSaveFileName, 462 calling, 454-455 CommDlgExtendedError, 462 declaring, 453-454 DeleteMenu, 458-459 DisplaySize, 457-458 FileIsOpen, 456-457 FindWindow, 458-459 GetComputerName, 455-456 GetSystemMenu, 458-459 GetUserName, 454-455 PlayWavSound, 462 SetTimer, 460 ShellExecute, 439, 461 WiringToExcelCoords() function, 509 With End With statement, 56 WithEvents statement, 416 WithNames() function, 135 wizards Pivot Table Wizard, 236-238 Text Import Wizard, 21, 38-39 delimited files, 392-394 files with less than 98,304 rows, 394-397 files with more than 98,304 rows, 397-398 fixed-width files, 388-391 Word automation, 359 bookmarks, 371-373 compile errors, 361 Document objects, 365-366 early binding, 359-361 filtered reports, 373-376 late binding, 362 object model, 364-365 object creation, 363-364 object references, 363-364 Range objects, 368-370 Selection objects, 367 How can we make this index more useful? Email us at indexes@quepublishing.com 545 546 Index WordEarlyBinding() function WordEarlyBinding() function, 361 Workbook_WindowActivate() event, 146 WordLateBinding() function, 362 Workbook_WindowDeactivate() event, 146 Workbook_Activate() event, 143, 159 Workbook_WindowResize() event, 146 Workbook_AddInInstall() event, 147, 159 workbooks checking for open workbooks, 77-78 combining, 300-301 converting to add-ins, 498-500 date/time of last save, retrieving, 81 deleting after specific date, 295 events list of, 143 Workbook_Activate(), 143, 159 Workbook_AddInInstall(), 147, 159 Workbook_AddInUninstall(), 147, 159 Workbook_BeforeClose(), 145-146, 159 Workbook_ BeforePrint(), 144-145, 160 Workbook_BeforeSave(), 144 Workbook_Deactivate(), 143 Workbook_NewSheet(), 146, 160 Workbook_Open(), 143-144, 160 Workbook_SheetActivate(), 147 Workbook_SheetBefore DoubleClick(), 147 Workbook_SheetBefore RightClick(), 147 Workbook_AddInUninstall() event, 147, 159 Workbook_BeforeClose() event, 145-146, 159 Workbook_BeforePrint() event, 144-145, 160 Workbook_BeforeSave() event, 144 Workbook_Deactivate() event, 143 Workbook_NewSheet() event, 146, 160 Workbook_Open() event, 143-144, 160 Workbook_SheetActivate() event, 147 Workbook_SheetBeforeDoubleClick() event, 147 Workbook_SheetBeforeRightClick() event, 147 Workbook_SheetCalculate() event, 147 Workbook_SheetChange() event, 148 Workbook_SheetDeactivate() event, 148 Workbook_SheetFollowHyperlink() event, 148 Workbook_SheetSelectionChange() event, 148 Workbook_SheetCalculate(), 147 Workbook_SheetChange(), 148 Workbook_SheetDeactivate(), 148 Workbook_SheetFollow Hyperlink(), 148 Workbook_SheetSelectionChange(), 148 Workbook_WindowActivate(), 146 Workbook_WindowDeactivate(), 146 Workbook_WindowResize(), 146 file paths, 77 hiding, 503 names, 77 number of workbooks, counting, 79 Personal Macro Workbook, 16 Report workbooks, 250-251 separating worksheets into, 299-300 Worksheet_Activate() event, 149 Worksheet_BeforeDoubleClick() event, 149 Worksheet_BeforeRightClick() event, 150 Worksheet_Calculate() event, 150 Worksheet_Change() event, 150-151 Worksheet_Change() function, 292, 319-320 Worksheet_Deactivate() event, 149 XML Worksheet_FollowHyperlink() event, 152 Worksheet_SelectionChange() event, 152 Worksheet_SelectionChange() function, 308, 326 worksheets See also cells; workbooks blank report worksheets, moving pivot table data to, 251 checking for, 78-79 filtering and copying data to, 301-302 separating into workbooks, 299-300 worksheet events, 149-152 WriteFile() function, 398 WriteHTML() function, 472 WriteMembershipHTML() function, 345-346 X-Z xlDelimited constant, 37 XML (Extensible Markup Language) Amazon.com query results, 354 multiple pages of results, 356-357 sample query, 355-356 defined, 349-350 round-tripping, 353-354 saving files as, 351 Schemas, 351-352 structure of, 350 tags, 350 as universal file format, 350-351 XML By Example, 350 XSL Transforms, 352 XLFiles() function, 385 XML By Example, 350 xlFilterCopy, 226-229 XML Maps dialog box, 355 xlFixedWidth constant, 37 XSL Transforms, 352 XLtoWiringCoords() function, 509 XY (scatter) charts, 196, 203 X button, disabling, 458-459 XButtonEnabled() function, 458 XcelFiles Web site, 308 xla file extension, 497 xlApp_NewWorkbook() function, 417 xlCellType constants, 72 xlChart_MouseDown() function, 419 xlColumnDataType constant, 391 xlTrailingMinusNumbers constant, 391 How can we make this index more useful? Email us at indexes@quepublishing.com 547 [...]... worksheets in a workbook and offered the first support for VBA macros Microsoft offered a Lotus 1-2-3 transition mode and their sales force began making serious inroads The mid-90s were the glory years in Excel development Excel 95 and Excel 97 were loaded with new features such as pivot tables, autofilter, and automatic subtotals The new VBA development environment was introduced in Excel 97 Microsoft was brilliant... Tom Urtis for technical editing Jerry Kohl for many of the ideas in this book Jeanette Garcia, Barb Jelen, and Doug and Stacy Jefferies for technical assistance Zeke, Josh, and Mary Ellen Jelen for their patience Tom Macioszek for peer review Chad Rothschiller at Microsoft for teaching me everything there is to know about Excel XML Dave Gainer, Steve Zaske, Eric Patterson, and Joe Chirilov at Microsoft. .. accounting, and operations departments of a $500 million public company He lives near Akron, Ohio, with his wife Mary Ellen and sons Josh and Zeke Tracy Syrstad works as a programmer and consultant for the MrExcel Consulting team She remembers the painful trek up the VBA learning curve while developing applications for co-workers at a former job She is co-editor of Holy Macro! It’s 1,900 Excel VBA Examples... Authors Bill Jelen, “Mr Excel, ” is an accomplished Excel author and the principal behind the leading Excel Web site, MrExcel.com As an Excel consultant, he has written Excel VBA solutions for hundreds of clients around the English-speaking world His Web site hosts more than 10 million page views annually Prior to founding MrExcel.com, Jelen spent 12 years in the trenches—working as a financial analyst for. .. VBA Examples CD and editor of Dreamboat On Word She lives on an arboreous acreage in eastern South Dakota with her husband John and dog General Dedications Dedicated to Mary Ellen Jelen Bill Dedicated to John Syrstad, whose confidence in me gave me strength to take this path Tracy xix xx VBA and Macros for Microsoft Excel Acknowledgments Thank you to Mala Singh of XLSoft Consulting for expertise with... a winning combination of Excel and VBA that sits on 400 million desktops around the world Today, I am 100% convinced that Excel will absolutely own the spreadsheet market for always and eternity Of course, I was wrong before The Future of VBA and Excel Star Office is not as good as Excel, but with every release, they get closer For someone who doesn’t need every feature of Excel, Star Office is good... samples designed to exhibit the power of Excel VBA Chapters 14–16 handle Web queries, XML, and automating another Office program such as Word The Techie Stuff Needed to Produce Applications for Others Chapter 17 shows you how to use arrays to build fast applications Chapters 18 and 19 handle reading and writing to text files and Access databases The techniques for using Access databases enable you to... offer VBA or any real macro language To me, a spreadsheet without a macro language is useless and therefore Star Office is not a credible threat to Excel Perhaps you’ve heard the rumblings from inside Microsoft that someday VBA may go away On one hand, this doesn’t seem possible Microsoft is still supporting XLM macros (the old Excel version 4 macro language) 11 years after VBA was introduced Microsoft. .. something useful For all the former BASIC programmers in the audience, I will decode this bizarre-looking language so that you can easily pick through recorded macro code and understand what is going on The Great News Excel with VBA Is Worth the Effort Although you’ve probably been frustrated with Microsoft over your inability to record macros in Excel, the great news is that Excel VBA is powerful Absolutely... Star Office: VBA 5 6 Introduction Security has moved to the forefront for Microsoft In October 2003, Microsoft announced new security initiatives that make it clear that security is job 1 at Microsoft This is relevant because the infamous Melissa virus spread rapidly by using VBA in Word The press and powers that be took this situation and moved VBA over to the endangered species list If Microsoft continues ... Authors Bill Jelen, “Mr Excel, ” is an accomplished Excel author and the principal behind the leading Excel Web site, MrExcel.com As an Excel consultant, he has written Excel VBA solutions for hundreds... e Introduction I First Steps up the VBA Learning Curve ?usinesssolutions VBA and Macros for  Microsoft Excel Unleash the Power of Excel with VBA! 11 This Sounds... husband John and dog General Dedications Dedicated to Mary Ellen Jelen Bill Dedicated to John Syrstad, whose confidence in me gave me strength to take this path Tracy xix xx VBA and Macros for

Ngày đăng: 05/01/2017, 22:45

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan