140 likes | 223 Views
情報基礎 A Lecture 15. Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information Systems. Programming VBA Data Processing plus. Chart Insertion. Procedure Call. Calling procedure from different procedure
E N D
情報基礎ALecture 15 Takeshi TokuyamaTohoku University Graduate School of Information SciencesSystem Information SciencesDesign and Analysis of Information Systems
Procedure Call • Calling procedure from different procedure • Procedure already written • Sub sum_ave_6sub() • Sub grade_6sub() • Sub student_ave() • Sub stat_pass_fail() • Sub stat_grade() • Sub chart() • Instead of executing each procedure, write a new procedure to call all of them
Procedure Call • Write procedures to execute in Sub score() • Call “Procedure name” • Six procedures are executed in order
Preparation • Download “hogehoge”
Exercise • Score data processing for 20 classes • Execute six process below for each file • Sub sum_ave_6sub() • Sub grade_6sub() • Sub student_ave() • Sub stat_pass_fail() • Sub stat_grade() • Sub chart() • Procedure name: score() • Output statistics of 20 classes into score.xls
File Operation • Open method • Open 20 files in order • Utilize number in filename as a variable • Save and close active file
Accessing the other file:Copy data to a file • Copy the number of student who got “A” for Japanese on sheet “Statistics” to score.xls->sheet:2011->Japanese->A • Copy a cell B4 on sheet “Statistics” of active file to a cell B3 on score.xls
Copy a path \\netsrv22\c90a1rlu\MyDocuments\foo\bar\baz.xls