tailieunhanh - Introduction to using macros in Microsoft Excel 2003 phần 6
8,4 phạm vi được đặt tên Đôi khi nó là dễ dàng hơn để đối phó với một phạm vi khi nó có một cái tên thay vì phải sử dụng ký hiệu A1. Một tên có thể được phạm vi vĩ mô trước khi được viết, hoặc vĩ mô có thể Đề cập: Row 4 Tất cả các hàng cột bảng tính hoạt động Cột D D Tất cả các cột trên bảng tính hoạt động | On Error GoTo Last in your macro where Last is a label attached to the Next r Last Next r The effect of this will be to continue doing calculations and just omit the result for C6. To continue with the next line when macro encounters an error If you wish your macro to execute the next line when an error condition occurs include the statement On Error Resume Next in the macro. For the macro described above the effect will be the same as that described in section . 14 Custom dialog boxes MsgBox and InputBox are two of Excel s built-in dialog boxes. You can create your own dialog boxes for passing information to and from a macro. A simple example is described below in which a decorator keeps a record of the paint he has in stock and provides a facility for customers to enquire about the availability of a particular colour in either gloss or matt paint. The controlling sheet To create the controlling sheet for this example Guide 39 Introduction to using macros in Microsoft Excel 2003 47 1 Open a new workbook and save it as 2 Name the first sheet CustomerEnquiries for example . 3 Make sure that the Drawing toolbar is visible View Toolbars Drawing . 4 Click the Oval button on the Drawing toolbar and draw the oval shape. 5 Right-click on the oval and select Add Text. 6 Type Paint queries 7 If you would like to give a 3-D effect to the oval click on the 3-D button on the Drawing toolbar and select one of the settings offered. Paint in stock sheet The record of tins of paint currently in stock is stored on another sheet. 1 Rename Sheet2 as Stock. 2 Enter the data as shown below. 3 Note that the paint colours are sorted alphabetically. 4 In cell I8 enter the formula VLOOKUP H4 B5 D14 H5 This will give a N A result since there is no data in H4 and H5 at the moment. Those values will be entered automatically when the customer indicates which paint they are enquiring about. 48 Guide 39 Introduction to using macros in Microsoft Excel 2003 5 If you .
đang nạp các trang xem trước