VBA excel help please

Joined
Sep 6, 2011
Messages
5
Reaction score
0
Hey, I'm meant to fill in a column to find the wind power given the speed?

The Power is a function of the wind speed as you can probably imagine and that function is provided to you in cell B12 with the wind speed parameter for it in B11. So what you need to do is

step 1. take the wind speed from your data and put it in B11 then B12 will automatically give the power for that wind speed.
step 2. copy that power value to the value column on the same row as the wind speed you input.
step 3. do this for all rows of your data.

That sounds like a long and hard task right? But thankfully step 1 have already been made into a function which you can find in your services module. steps 2 and 3 can be done easily by writing a loop which continues the aforementioned function for all rows until you reach the empty row. The loop you should be using is a while loop, since the number of rows of data could vary and you can tell the while loop to stop until you reach the empty row.

# I know how to do the above but I don't know how to write a loop to implement this to get the power into the column.
My first Wind Speed is in F4 and where my Power answer goes is in H4
Also, in B11, there is an "input speed to power func", that's where the Windspeed goes which goes into B12, which is the "power curve (formula) and contains this formula inside
=IF(sp<12.4, -0.6847*sp^4 + 15.849*sp^3 - 93.73*sp^2 + 331.41*sp - 413.72, -12.618*sp^2 + 257.47*sp + 2061.1)

Could anyone help me with writing a loop to solve this VBA question?

THANK YOU
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,739
Reaction score
1,204
I don't have a clue ... this looks like "homework", I never took work home, even when in school ... :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top