VBA/ Excel HELP! please :)

emmcee

New Member
Joined
Sep 9, 2011
Messages
29
Hey for my assignment Im 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 SO MUCH
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello-

Welcome to the board.

Please don't take this the wrong way, but I don't think anyone here wants to complete your assignment.

If you could take a best effort, produce some code and then post it here, then someone may chime in with some help on the spots where you are getting stuck.

Have you checked out the topic "Do...Loop Statement " within VB Help? That should get you up and running.

Regards, Marc
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top