Excel 2003 VBA Regression/ Loop Help...winner gets a book of cookies

Vito

New Member
Joined
Oct 4, 2011
Messages
1
Okay I need help writing this macro on something I do on a weekly basis, not sure how to do it. Keep in mind I’m in excel 2003 so the macro recorder isn’t as good as 2007. I’ve done a lot of simple macros, but nothing like this. I’m sure it’s simple, but it’s new to me and I am lost.

On a sheet called “List” in column C I have departments going down from C2:C44, in C45 I have the text “END”

Macro needed to be written:
1. In a sheet called “Model” in cell B1 take the first dept from the above sheet called “list” (link this cell to List C2 the first time, second time steps repeated List C3, ect)
2. Calculate/ F9 (rest of formulas in work book)
3. In sheet “Model” I need to do a regression on Y Input = $s$5:$s$160, X Input $az$5:$AZ$160, Confidence Level 95%, output range $Y$22
4. Execute regression
5. Calculate/ F9 (rest of formulas in work book)
6. Copy a calculated cell range which is formula driven after the regression is finished from “Model” “E5:E56”
7. Paste values and transpose into a sheet called “Data” starting in Cell D5 for the first dept. (2nd time D6, 3rd D7, ect)

Repeat above steps until step #1 dept reaches “End” also step 7 will continue pasting the values and transposing them down starting so that all depts are listed.

Who ever can walk me through this first gets a box of cookies mailed to them. PS I do this on Fridays so I should mail you a beer too!

-Vito-
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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