Lựa chọn và sửa đổi các sự kiện tờ. Chúng tôi cũng cần phải làm quá trình này cho bảng thứ lượt đầu tiên của tất cả các hình thức GọiHãy thử cách nhấn vào giữa tờ, và hai biểu đồ khác nhau nên bật lên trong bảng tương ứng. Chúng ta cũng cần để khởi tạo bảng tính. Kích đúp vào trong thư mục ThisWorkbook, và chọn sự kiện | Example 12 555 Timer Figure 12-6 Selecting and modifying sheet events. We also need to do the same process for the second sheet. Double-click on Sheet2 Astable and find the associated Worksheet_Activate event. Add the code as follows Private Sub Worksheet_Activate first turn of all forms Call HideForms End Sub Try clicking between sheets and the two different diagrams should pop up in the respective sheet. We also need to initialize the workbook. Double-click in ThisWorkbook folder and select the WorkbookOpen event. Add this code to close all forms and then activate the first sheet and as a consequence showing the monostable diagram . Private Sub Workbook_Open Call HideForms Sheets Monostable .Select End Sub 211 Excel by Example Figure 12-7 Worksheet with form shown smack-dab in the middle of the window. Modifying Form Location As can be seen from Figure 12-7 placing the picture in the middle of the worksheet may prove irritating in operation so let s change the process to place the form in the lower righthand of the window. First we must change the StartUpPosition property of both forms to 0 - Manual. This will prevent the position of the form from being reinitialized every time the Show procedure is executed. Then we modify both event procedures as follows For the Monostable sheet activation Private Sub Worksheet_Activate first turn of all forms Call HideForms positioning the form at the bottom _ _ - positioning the form at the right _ _ - 212 Example 12 555 Timer End Sub and for the Astable sheet activation Private Sub Worksheet_Activate first turn of all forms Call HideForms positioning the form at the bottom _ _ - positioning the form at the right .