tailieunhanh - Introduction to using macros in Microsoft Excel 2003 phần 3
Một font chữ đậm được sử dụng để chỉ ra tên là các phím trên bàn phím, ví dụ, Esc và Enter, đại diện các phím được đánh dấu Esc và Hướng dẫn 39 Giới thiệu về sử dụng các macro trong Microsoft Excel 2003 tháng 6 năm 2006 Đại học Durham Dịch vụ Công nghệ thông tin | Example 2 Dim heightvage 1 to 80 1 to 80 As Single creates a two-dimensional array. Example 3 The function called Array can create an array from a list of variables as in Children Array Michael Bridget Peter When Array is used the variables are of type Variant. Note Redim can be used to set up an array that can be re-sized but that will not be described in this document. Using Set Although most methods return values some like Offset see section return objects. You cannot assign an object to a variable using an equals sign. Instead you should use the Set statement for example Set rangeOffset Range C1 C5 .Offset 1 1 6 Getting Help Context-sensitive help While you are writing a macro in the Microsoft Visual Basic window you can access help about any particular item such as Range as follows Select the item. Press F1. Excel will display the appropriate help if it is available. Help topics dialog box To access the Help Topics dialog box Make sure the Visual Basic window is the active one. From the Help menu select Microsoft Visual Basic Help. You can either perform a search or choose whichever topic is most appropriate for your needs from the list. Object Browser The Object Browser can be used to view the objects methods and properties of Excel in addition to many of the functions and statements provided by Visual Basic. 1 If Microsoft Visual Basic is already active switch to that window if not select Tools Macro Visual Basic Editor . 2 From the View menu select Object Browser or press F2 . Guide 39 Introduction to using macros in Microsoft Excel 2003 17 The scroll box in the middle contains a list of the various classes of objects. A class is just a description of a type of object for example a particular chart belongs to the Chart class . Classes belong to a project or library. 3 Click on the downward pointing triangle beside All Libraries and select Excel. Now just those classes belonging to Excel are displayed. 4 In the Classes area scroll down .
đang nạp các trang xem trước