Sie sind auf Seite 1von 4

Experiment No. 5 Visual Basic Application for Banking System 1.

Objective(s): The activity aims to know about the different commands for creating, deleting and printing a workbook. 2. Intended Learning Outcomes (ILOs): The students shall be able to: 2.1 Have an idea for the commands of creating, deleting and printing a workbook. 2.2 Know the different commands to create, delete, and print a workbook for easily and for the good work of the program. 2.3 Understand what the importance of the different command for the program. 2.4 Understand how to create a program with a combination of loops and the commands for creating, deleting and printing workbook. 3. Discussion (not more than 300 words): In creating this program we use user form, to open a branch first create an excel files with corresponding branch names, and then in the main program use the code workbook.open and the branch names file location. We use if else statement to alphabetize the worksheets, and to put a password in a worksheet we declare a x and y variable as a string and we use the worksheet.protect method. To delete a choose account we use sheets.delete and to print a choose account we use sheets.printout. 4. Resources: Computer VBA Excel 5. Procedure: 1. Click Start, then click Microsoft Excel 2. Open the visual basic editor 3. To create a module, on the main menu, click Insert then module 4. click the userform 5. make a workbooks with branch name 6. type these code in the userform1 Private Sub CommandButton1_Click() Branch.Show End SubPrivate Sub UserForm_Click() End Sub * For the branches Private Sub Caloocan_Click() Workbooks.Open Filename:="C:\Users\Ferrer\Desktop\PROGRAM\Caloocan Branch.xlsm" Branch.Hide BPI.Hide condition.Show End Sub

Private Sub Makati_Click() Workbooks.Open Filename:="C:\Users\Ferrer\Desktop\PROGRAM\Makati Branch.xlsm" Branch.Hide BPI.Hide condition.Show End Sub Private Sub Marikina_Click() Workbooks.Open Filename:="C:\Users\Ferrer\Desktop\PROGRAM\Marikina Branch.xlsm" Branch.Hide BPI.Hide condition.Show End Sub Private Sub Pasig_Click() Workbooks.Open Filename:="C:\Users\Ferrer\Desktop\PROGRAM\Pasig Branch.xlsm" Branch.Hide BPI.Hide condition.Show End Sub Private Sub Quezon_Click() Workbooks.Open Filename:="C:\Users\Ferrer\Desktop\PROGRAM\Quezon Branch.xlsm" Branch.Hide BPI.Hide condition.Show End Sub Private Sub UserForm_Click() End Sub 7. to print Private Sub CommandButton1_Click() Dim x As String x = InputBox("What sheet name? ") Sheets(x).PrintOut End Sub Private Sub CommandButton2_Click() Dim x As String Dim y As String x = InputBox("Enter Password: ")

y = InputBox("What sheet name do you want to put password ?") Worksheets(y).Protect Password:=(x), AllowFormattingCells:=True End Sub Private Sub CommandButton3_Click() Dim a As String a = InputBox("Which sheet do you want to delete? ") Sheets(a).Delete End Sub Private Sub UserForm_Click() End Sub 8. Type these codes to make the worksheets alphabetize Sub aaa() Dim x As String Dim y As Integer y = Sheets.Count For n = 1 To y x = Sheets(n).Name For m = n To y If Sheets(m).Name < x Then x = Sheets(m).Name End If Next Sheets(x).Move before:=Sheets(n) Next End Sub Course: ECE400L2 Group No.: Group Members: Ferrer, Yzac Kristopher Almoradie, Reynado E. Mabaga, Argel Linard F. 6. Data and Results: Experiment No.: 5 Section: EC31FB1 Date Performed: 8/18/13 Date Submitted: 8/19/13 Instructor: Engr. Alexa Ray Fernando

7. Conclusion: I therefore conclude that creating, deleting and printing a workbook is not only for manually do only, but theres a command for doing it, and you can make use this command to make a good program that needs a creating, deleting and printing a workbooks. There are also a command to open, add, copy the content, move, hide, save, protect, sort and etc. a workbook and worksheet.

8. Assessment (Rubric for Laboratory Performance): Good .Thus the experiment gave you an idea about the commands of creating, deleting and printing workbook? Very Good .Thus the experiment teaches you about the techniques of combining loop command for the good program? Perfect .Thus the experiment is good enough for the new topic? Perfect .Thus the experiment have a purpose to built your creative thinking in making good program?