Joke Collection Website - Joke collection - Don't be afraid, Excel VBA is actually a very simple introduction to the author.

Don't be afraid, Excel VBA is actually a very simple introduction to the author.

Luo Guofa, whose net name is ggsmart, also known as Ye Feng, is the official Weibo administrator of Excel Home and one of the most popular lecturers in Excel Home Free Online Training Center. Middle school teachers have rich experience in education and training, are good at Excel data processing and analysis, and have rich learning experience and practical experience in programming with Excel VBA. Its technical posts and courseware published on Excel Home have become the enlightenment materials for a large number of beginners of Excel VBA.

Zhou Qinglin, net name Kevin, the most senior Microsoft MVP in China, founder and stationmaster of Excel Home. Engaged in enterprise finance and information management for many years, and has in-depth research on the application of Microsoft Office in sales, finance, logistics and enterprise management. Participated in planning and writing dozens of best-selling office technology books. At the same time, he is also an excellent technical consultant and training lecturer with rich teaching experience.

catalogue

1 Enter the world of Excel VBA 1. 1 I really can't afford to hurt people who can't excel 1. 1 endless watch 1.2 Fast Superman/kloc-0. Let others repeat it. 1.2. 1 What is a macro? 1.2.2 Record Excel operations with macros. 1.2.3 Let the recorded operation be reproduced again. 1.3 How to execute a macro? 1.3. 1 Set macro shortcuts. Give the button 1.3.3 Assign the macro to the common toolbar button 1.4 Who is blocking the macro 1.4. 1 Why can't the macro work?

1 Enter the world of Excel VBA 1. 1 I really can't afford to hurt people who can't excel 1. 1 endless watch 1.2 Fast Superman/kloc-0. Let others repeat it. 1.2. 1 What is a macro? 1.2.2 Record Excel operations with macros. 1.2.3 Let the recorded operation be reproduced again. 1.3 How to execute a macro? 1.3. 1 Set macro shortcuts. Give the button 1.3.3 Assign the macro to the common toolbar button 1.4 Who is blocking the macro 1.4. 1 why the macro doesn't work 1.4.2 How to modify the macro security level 1.5 VBA, Excel programming language/kloc-0.

Chapter 2 begins the first step of VBA programming. 2. 1 Uncover the true face behind the mystery. 2. 1 Where is the program saved? 2. 1.2 How to write the program? 2.2. 1 What's in the program? 2.2. 1 Code 2.2.2 Process 2.2.3 Module 2.2.4 Object 2.2.5 Object Attribute 2.2.6 Object Method 2.2.7 Keyword 2.3 VBA Programming Environment -VBE 2.3. 1 Open VBE Editor 2.3.2 Main Window 2.3.3 Menu Bar 2.3.4 Toolbar. 2.3.7 code window 2.3.8 immediate window 2.4 try to write a simple VBA program 2.4. 1 add or delete a module 2.4.2 write a program manually 2.5 dispel doubts and fall in love with a key.

Chapter 3 Basic Grammar of Excel VBA 3. 1 Grammar, Programming Basis 3. 1. 1 This joke is cool. 3.65438+3.2 VBA and grammar. 3. Is1.3 VBA grammar difficult to learn? 3.2 The data type of VBA 3.2. 1 The story of soy sauce 3.2.2 Walking into the Excel store 3.2.3 What are the VBA? Data type 3.3 Container for storing data: constants and variables 3.3. 1 constants and variables 3.3.2 Use variables 3.3.3 Use constants 3.3.4 Use arrays 3.4 Set, objects, properties and methods 3.4. 1 object, just like an egg in the refrigerator, 3.4.2. Properties of objects, 3.4.3. Object, 3.5. Bridge connection, VBA operator 3.5. 1 arithmetic operator 3.5.2 comparison operator 3.5.3 connection operator 3.5.4 logic operator 3.5.5 What should I do first 3.6 built-in function 3. 6. 1 VBA function 3.6.2 What function 3.7 control program of VBA? Ok, the basic sentence structure of VBA is 3.7. 1 If…Then statement 3.7.2 Select Case statement 3.7.3 For…Next statement 3.7.4 Do While statement 3.7.5 Do Until statement 3.7.6 For Each…Next statement 3.7.7 Other commonly used. Statement 3.8 subprocess, basic program unit 3.8. 1 About VBA process 3.8.2 What you need to know when writing subprocess 3.8.3 The scope of executing process 3.8.4 from another process 3.9 Custom function, function process 3.9. 1 Try to write a function 3.9.2 How to use a custom function to count the number of cells in a specified color 3.9. 3.9. 3.9. 4 Declare the function process and standardize the statement 3.65438 Necessary habits 3. 10.2 How to typeset the code 3. 10.3 Comment to make the code intention clear.

Chapter 4 Common Objects 4. 1 Communication with Excel, Common Objects 4.1./VBA Programming and Cooking 4.1.2 How does VBA control Excel 4. 1.3 Which objects should I remember 4.2? The topmost application object 4.2. 1 ScreenUpdating attribute 4.2.2 DisplayAlerts attribute 4.2.3 EnableEvents attribute 4.2.4 WorksheetFunction attribute 4.2.5 Dress up Excel 4.2.6. She and her children manage the workbook 4.3, understand the workbook object 4.3. 1 workbook and workbook 4.3.2 Understand the workbook, what do you need to know 4.3.3 Practical operation, what can you do? 4.3.4 ThisWorkbook and ActiveWorkbook 4.4 operate the worksheet, knowing the worksheet object 4.4. 1 knowing the worksheet object 4.4.2 operating the worksheet 4.4.3 and the worksheet 4.5 core, and the crucial Range object 4.5. 1 refers to the Range object 4.5.2 in many aspects. How can I get the cell 4.5.3 operation cell? What else do you need to know? 4.5.4 Intimate contact and manipulation of cells 4.6 are more than that. Other common object names are 4.6. 1. Name Set 4.6.2 Cell Annotation and Annotation Object 4.6.3 Form Cell 4.7 Typical Skills and Examples 4.7. 1 Create Workbook 4.7.2 Judge whether the Workbook is open 4.7.3 Judge whether the Workbook exists 4.7.4 Enter data into an unopened Workbook 4.7.5 Hide all worksheets except active sheet 4.7.6. Batch new worksheets 4.7.7 Batch classified data 4.7.8 Save worksheets as new workbooks 4.7.9 Quickly merge multi-table data 4.7. 10 Summarize multi-workbook data in the same folder 4.7. 1 1 Create a directory for worksheets.

Chapter 5 Excel Events 5. 1 Let Excel automatically respond to your actions 5. 1. 1 Let Excel automatically say hello to the events 5. 1.2. VBA automatically switches 5. 1.3 Event Process 5. 1.4 Write Event Process 5.2 Worksheet Events 5.2. 1 About Worksheet Events 5.2.2 Common Worksheet Events 5.2.3 Worksheet Event List 5.3 Workbook Events 5.3. 1 About Workbook Event 5.3.2 Common Workbook Event 5.3.3 Workbook Event List 5.4 Different Automation 5.4. 1 Mouse Movement Event 5.4.25. 1 Do one more thing and quickly enter data 5.5.2 Which exam should I invigilate 5.5.3 Let the file be automatically saved every minute.

Chapter VI User Interface Design 6. 1 Freely design the interface in Excel 6. 1. 1 About the user interface 6. 1.2 controls, the indispensable palette 6.2 uses controls. Treat the worksheet as a canvas 6.2. 1 Use the form controls in the worksheet 6.2.2 Use the ActiveX controls in the worksheet 6.2.3 Difference between form controls and ActiveX controls 6.3 Interaction with users, simple input/output dialog 6.3. 1 InputBox function 6.3.2 InputBox method of application object 6.3.3 MsgBox function 6.3.4 FindFile method of application object 6.3.5 GetOpenFi Lename method of application object 6.3 Design your own interactive interface 6.4. 1 About User Form 6.4.2 Add a User Form 6.4.3 Set the properties of the form 6.4.4 Add a control on the form 6.4.5 Display the form 6.4.6 Close the form 6.4.7 Use the control 6.4.8 Use the keyboard control 6.5 to transform the existing Excel. Interface 6.5. 1 Change the program name of the title bar 6.5.2 Show or hide the menu bar 6.5.3 Show or hide the toolbar 6.5.4 Setup window 6.5.5 Other settings 6.6 Typical skills or examples 6.6. 1 Design a questionnaire 6.6.2 Employee information management interface 6.6.3 A simple one.

Chapter VII Code Debugging and Optimization 7. Possible Errors in1VBA 7. 1 Compilation Error 7. 1.2 Runtime Error 7. 1.3 Logical Error 7.2 Three States of VBA Program 7.2. 1 Design mode 7.2.2 Running mode 7.2.3 Interrupt mode 7.3 Debugging tool prepared by Excel 7.3. 1 Let the program enter interrupt mode 7.3.2 Set breakpoints for the program 7.4. 1 Go Error Goto Tag 7.4.2 On Error Resume Next 7.4.3 On Error Goto 0 7.5 Makes Code Run Faster 7.5. 1 Reasonable Use of Variables 7.5.2 Avoid Repeated Reference to the Same Object 7.5.3 Make Code Run Faster as far as possible. Use the function 7.5.4 to remove redundancy, activate the selection 7.5.5, and use the array 7.5.6 reasonably to close the screen update and complete the calculation.