|
-
Aug 6th, 2003, 02:15 PM
#1
Thread Starter
New Member
I need some Help!
I am an engineering student here at MSU and I have an ndipendent study class for the summer, for part of this class I have to demonstrate my proficiancy with Visual Basic for excel, the problem is I haven't had a programming class yet and I know next to nothing about writing code. My professor said that it is very easy and should only take a couple of hours to figure out, and that was about the extent to which he was willing to help me, so here I am.
The three programs that I need to write for excel are as follows:
1)Write as visual basic subroutine named trans(). The subroutine should:
a)Let the user identify, using the mouse, a set of numbers in the spreadsheet that is always 2 columns wide but can have any number of rows.
b)assign these values to a 2-dimensional array named X
c)store the values in a second array named Y that is identical to X, except that the row and column positions are switched-for example the value in X(1,2) would be the same as the value in Y(2,1) and
d)return the array Y to the spreadsheet with the upper-left hand corner indicated by the user
2)Write a visual basic user defined function named interp(). The function should linearly interpolate a value of y from the table below*, given the value of x that is of interest, and the values of x and y that bracket the value of x of interest (so, the function will pass five variables to visual basic and return the interpolated value of y). You can assume that the user can correctly choose the values from the table that bracket the value of x of interst. (*here is the table and example he gave me)
x Y
1.00 2.00 Example:
1.20 2.50
2.00 3.00 When x = 1.25, y = 2.53125
2.70 3.50
3.00 4.00
3.50 4.50
3.90 5.00
4.20 5.50
4.40 6.00
5.60 6.50
6.10 7.00
7.10 7.50
8.80 8.00
3)Write a visual basic subroutine named ratio() the subroutine should:
a)let the user identify, using the mouse, a set of numbers in the spreadsheet that is always 2 columns wide but can have any number of rows,
b)assign these values to 2 different one-dimensional arrays named X, and Y,
c)determine the average ratio of corresponding x(i) to Y(i) values and return this average to a cell in the spreadsheet that is specified by the user.
I'm going to be working on these problems for the next couple of days (they are all 3 due on friday), so please understand I'm not asking anyone to do these problems for me, I just need some advice on how to get started and maybe have some (ok, probably a lot of questions) answered along the way. I know that it may seem like a cop-out to be asking for help on these problems and they probably seem very easy compared to most of the topics discussed here, but I am honestly stuck here and any and all help on these would be tremendously appriciated. Thank you very much for your time and patience,
sincerely
One tired engineering student
Jason
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|