Class15 - Class meeting #15 Wednesday, Oct 13th GEEN 1300...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 GEEN 1300 Introduction to Engineering Computing Class meeting #15 Wednesday, Oct 13 th Homework #7, posted, due next Wednesday ± cell ranges as arguments to functions ± creating array variables in VBA ± accessing a spreadsheet range directly from VBA 2 Clicker Questions How do you create/remove a breakpoint on a line of VBA code? A) press the F9 key B) press the Ctrl-F8 key combination C) click on the breakpoint command button on the VBE menu bar D) click in the margin to the left of the line E) say “gimme a break” into your computer’s microphone
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 3 Which VBA code implements this flowchart? A) For y > x If y <> x Then y = x-1/3 Next y B) Do While y > x If y <> x Then y = x - 1/3 End If Loop C) Do If y <> x Then y = x - 1/3 Loop Until y > x D) Do If y ~= x Then y = x - 1/3 End If End Do E) Do If y <> x Then y = x - 1/3 If y <= x Then Exit Do Loop 4 Array Data Structures Example: a set of pH measurements on treated wastewater 6.2 7.1 7.2 7.6 7.1 7.5 7.0 8.5 7.0 6.5 7.0 6.8 7.7 7.8 8.1 These measurements can be stored on the spreadsheet and they can be stored in an array variable in VBA. In either case, it is convenient to refer to the set of measurements by a single identifier and then refer to individual measurements using a subscript. pH 4 the 4 th item in the pH array This type of referencing is handled differently in Excel and VBA and cross-referencing from Excel to VBA is distinct also.
Background image of page 2
3 5 Accessing a spreadsheet range directly from VBA Note: It is not necessary to reference a particular worksheet since a range name is global throughout the workbook.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

Class15 - Class meeting #15 Wednesday, Oct 13th GEEN 1300...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online