Department of Biosystems and Agricultural Engineering                           Phone: (405) 744-4337

Oklahoma State University                                                                         Fax:      (405) 744-6059

Stillwater, OK 74078                                                     EMAIL: mstone@ceat.okstate.edu

 

MEMORANDA

 

Date:                November 1, 2005

To:                   BAE 1012

From:               Marvin Stone, Biosystems and Agricultural Engineering

Subject:            Homework Assignment #6

 

Use Excel™ VBA (Visual BASIC for Applications) to create The following Macro Programs:

 

1.       A macro that will double space the first 24 lines of a worksheet and set the background color for the inserted lines to light green.  This macro should insert a blank row after the first row and then after each additional line of the worksheet creating a sheet that would have 48 rows from a sheet with 24 rows initially.  This macro should be named double_space.

 

2.       A macro which fills the cells in the range A1:AE31 with the result of the following equation

 

Value =  Sin(3.14159 * ((i - 16) ^ 2 + (j - 16) ^ 2) / (7 * 30)) *( j - 1)

 

where i and j are the row and column indices and range from 1 to 30.

 

3.       A macro that creates a contour chart of the above function.  The chart should have an appropriate title with no x, y, or z axis, no x, y, or z labels, no walls or floor.

 

4.       Nine new spreadsheet functions that perform unit conversion.  The following functions should be created:

1

Conversion

Function name

2

Newtons to pounds

newton2pound()

3

pounds to Newtons

pound2newton()

4

meters to feet

meter2feet()

5

feet to meters

feet2meter()

6

Watts to HP

watts3hp()

7

HP to Watts

hp3watts()

8

Acres to Hectares

ac2ha()

9

Hectares to Acres

ha3ac()

 

You should create a simple spreadsheet that demonstrates each of these functions.

 

Create a printed copy of the macro programs with your name at the top of each macro, have the function of each checked me and turn in the copy.

 

This assignment is due: November 11th.